doris icon indicating copy to clipboard operation
doris copied to clipboard

[improment](executor)Add query type in active_queries() tvf

Open wangbo opened this issue 1 year ago • 8 comments

Proposed changes

1 Add query type in active_queries() tvf. 2 Add audit log for broker load task.


mysql [(none)]>select * from active_queries();
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+------------------+-----------------+----------+------------------+-----------+---------------------------------------------+
| BeHost     | BePort | QueryId                           | StartTime           | QueryTimeMs | WorkloadGroupId | QueryCpuTimeMs | ScanRows | ScanBytes  | BePeakMemoryBytes | CurrentUsedMemoryBytes | ShuffleSendBytes | ShuffleSendRows | Database | FrontendInstance | QueryType | Sql                                         |
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+------------------+-----------------+----------+------------------+-----------+---------------------------------------------+
| 127.0.0.1 |   6090 | 4940fc2db882446a-afd344993ab21465 | 2024-02-22 18:57:32 |           6 |           10002 |              0 |        3 |     471040 |            942080 |                      0 |                0 |               0 |          | localhost   | QUERY     | select * from active_queries()              |
| 127.0.0.1 |   6090 | 8a6a0142f04b4642-96eb374827274962 | 2024-02-22 18:57:29 |           7 |           10002 |              0 |        3 |     471040 |            942080 |                      0 |                0 |               0 |          | localhost   | QUERY     | select * from active_queries()              |
| 127.0.0.1 |   6090 | 4e398e72237c4e1d-afb1c1bac71f8d5e | 2024-02-22 18:57:16 |       19334 |           10002 |          12132 |  7776891 | 9464651776 |         897805983 |              881363254 |                0 |               0 |          | localhost   | INSERT    | insert into hits_10w_dst select * from hits |
| 127.0.0.1 |   6090 | c1df18e146cc4135-accfbfc6c2dc267c | 2024-02-22 18:57:33 |           6 |           10002 |              0 |        2 |     471040 |            942080 |                      0 |                0 |               0 |          | localhost   | QUERY     | select * from active_queries()              |
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+------------------+-----------------+----------+------------------+-----------+---------------------------------------------+


mysql [(none)]>select * from active_queries();
+------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+---------------------------------------+
| BeHost     | BePort | QueryId                          | StartTime           | QueryTimeMs | WorkloadGroupId | QueryCpuTimeMs | ScanRows | ScanBytes | BePeakMemoryBytes | CurrentUsedMemoryBytes | ShuffleSendBytes | ShuffleSendRows | Database | FrontendInstance | QueryType   | Sql                                   |
+------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+---------------------------------------+
| 127.0.0.1 |   6090 | 44500e307158734-95cbbb5824a37eac | 2024-02-22 18:58:08 |        2973 |           10002 |           1775 |   251968 | 246046720 |          19587808 |                      0 |                0 |               0 | hits     | localhost   | STREAM_LOAD |  stream load into table: hits_10w_dst |
+------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+---------------------------------------+
1 row in set (0.01 sec)

mysql [(none)]>select * from active_queries();
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+--------------------------------+
| BeHost     | BePort | QueryId                           | StartTime           | QueryTimeMs | WorkloadGroupId | QueryCpuTimeMs | ScanRows | ScanBytes | BePeakMemoryBytes | CurrentUsedMemoryBytes | ShuffleSendBytes | ShuffleSendRows | Database | FrontendInstance | QueryType   | Sql                            |
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+--------------------------------+
| 127.0.0.1 |   6090 | 9e65007a3b644494-a5bd93e30645177c | 2024-02-22 19:00:10 |         145 |           10002 |              1 |       25 |    106496 |            115264 |                      0 |                0 |               0 |          | localhost   | BROKER_LOAD |                                |
| 127.0.0.1 |   6090 | 2746a0cc6d049a4-896020a3f6ee158a  | 2024-02-22 19:00:09 |           5 |           10002 |              0 |        0 |         0 |            471040 |                      0 |                0 |               0 |          | localhost   | QUERY       | select * from active_queries() |
| 127.0.0.1 |   6090 | 8fba30b28cbc4b99-9b1c0e81874c5517 | 2024-02-22 19:00:11 |           7 |           10002 |              0 |        1 |    471040 |            942080 |                      0 |                0 |               0 |          | localhost   | QUERY       | select * from active_queries() |
| 127.0.0.1 |   6090 | 5c60dfb870e49a7-a92b8fdd5793850d  | 2024-02-22 19:00:13 |           5 |           10002 |              0 |        1 |    471040 |            942080 |                      0 |                0 |               0 |          | localhost   | QUERY       | select * from active_queries() |
+------------+--------+-----------------------------------+---------------------+-------------+-----------------+----------------+----------+-----------+-------------------+------------------------+------------------+-----------------+----------+------------------+-------------+--------------------------------+
4 rows in set (0.00 sec)


wangbo avatar Feb 22 '24 11:02 wangbo

Thank you for your contribution to Apache Doris. Don't know what should be done next? See How to process your PR

doris-robot avatar Feb 22 '24 11:02 doris-robot

run buildall

wangbo avatar Feb 22 '24 11:02 wangbo

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Feb 22 '24 11:02 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Feb 22 '24 12:02 github-actions[bot]

run buildall

yiguolei avatar Feb 22 '24 15:02 yiguolei

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Feb 22 '24 16:02 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Feb 22 '24 17:02 github-actions[bot]

run buildall

wangbo avatar Feb 23 '24 02:02 wangbo