[Feature](information_schema) add processlist table for information_schema db#32511
[Feature](information_schema) add processlist table for information_schema db#32511zy-kkk merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
|
||
| static std::string extract_db_name(const std::string& full_name); | ||
|
|
||
| static Status show_process_list(const std::string& ip, const int32_t port, |
There was a problem hiding this comment.
warning: parameter 'port' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
| static Status show_process_list(const std::string& ip, const int32_t port, | |
| static Status show_process_list(const std::string& ip, int32_t port, |
| {"STATE", TYPE_VARCHAR, sizeof(StringRef), false}, | ||
| {"INFO", TYPE_VARCHAR, sizeof(StringRef), false}}; | ||
|
|
||
| SchemaProcessListScanner::SchemaProcessListScanner() |
There was a problem hiding this comment.
warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
be/src/exec/schema_scanner/schema_processlist_scanner.cpp:43:
- : SchemaScanner(_s_processlist_columns, TSchemaTableType::SCH_PROCESSLIST) {}
+ : SchemaScanner(_s_processlist_columns, TSchemaTableType::SCH_PROCESSLIST) = default;| return _fill_block_impl(block); | ||
| } | ||
|
|
||
| Status SchemaProcessListScanner::_fill_block_impl(vectorized::Block* block) { |
There was a problem hiding this comment.
warning: method '_fill_block_impl' can be made static [readability-convert-member-functions-to-static]
be/src/exec/schema_scanner/schema_processlist_scanner.h:47:
- Status _fill_block_impl(vectorized::Block* block);
+ static Status _fill_block_impl(vectorized::Block* block);| return _fill_block_impl(block); | ||
| } | ||
|
|
||
| Status SchemaProcessListScanner::_fill_block_impl(vectorized::Block* block) { |
There was a problem hiding this comment.
warning: function '_fill_block_impl' has cognitive complexity of 57 (threshold 50) [readability-function-cognitive-complexity]
Status SchemaProcessListScanner::_fill_block_impl(vectorized::Block* block) {
^Additional context
be/src/exec/schema_scanner/schema_processlist_scanner.cpp:79: +1, including nesting penalty of 0, nesting level increased to 1
if (row_num == 0) {
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:83: +1, including nesting penalty of 0, nesting level increased to 1
for (size_t col_idx = 0; col_idx < _s_processlist_columns.size(); ++col_idx) {
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:90: +2, including nesting penalty of 1, nesting level increased to 2
for (size_t row_idx = 0; row_idx < row_num; ++row_idx) {
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:97: +3, including nesting penalty of 2, nesting level increased to 3
switch (col_idx) {
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:99: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 1 ? row[1] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:102: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 2 ? row[2] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:105: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 3 ? row[3] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:108: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 5 ? row[5] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:111: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 6 ? row[6] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:114: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 7 ? row[7] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:117: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 8 ? row[8] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:120: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 9 ? row[9] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:123: +4, including nesting penalty of 3, nesting level increased to 4
column_value = row.size() > 11 ? row[11] : "";
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:130: +3, including nesting penalty of 2, nesting level increased to 3
if (_s_processlist_columns[col_idx].type == TYPE_LARGEINT ||
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:130: +1
if (_s_processlist_columns[col_idx].type == TYPE_LARGEINT ||
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:132: +4, including nesting penalty of 3, nesting level increased to 4
int128_t val = !column_value.empty() ? std::stoll(column_value) : 0;
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:135: +1, nesting level increased to 3
} else {
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:142: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(fill_dest_column_for_range(block, col_idx, datas));
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/exec/schema_scanner/schema_processlist_scanner.cpp:142: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(fill_dest_column_for_range(block, col_idx, datas));
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
morningman
left a comment
There was a problem hiding this comment.
Please add test cases in next PR
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run buildall |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run compile |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 37354 ms |
|
run buildall |
TPC-H: Total hot run time: 38005 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 181049 ms |
|
run buildall |
TPC-H: Total hot run time: 38154 ms |
TPC-DS: Total hot run time: 181240 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
TeamCity be ut coverage result: |
|
run feut |
|
run buildall |
TPC-H: Total hot run time: 38056 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 181242 ms |
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run feut |
|
PR approved by at least one committer and no changes requested. |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...