-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improment]Add workload group resource usage #39177
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
be/src/exec/schema_scanner/schema_workload_group_resource_usage_scanner.cpp
Show resolved
Hide resolved
be/src/exec/schema_scanner/schema_workload_group_resource_usage_scanner.cpp
Show resolved
Hide resolved
{"BE_ID", TYPE_BIGINT, sizeof(int64_t), false}, | ||
{"WORKLOAD_GROUP_ID", TYPE_BIGINT, sizeof(int64_t), false}, | ||
{"MEMORY_USAGE_BYTES", TYPE_BIGINT, sizeof(int64_t), false}, | ||
{"CPU_USAGE", TYPE_VARCHAR, sizeof(StringRef), false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个可能不行,不行就把百分号去掉。否则用户没法排序
be/src/olap/delta_writer_v2.cpp
Outdated
@@ -163,6 +163,13 @@ Status DeltaWriterV2::write(const vectorized::Block* block, const std::vector<ui | |||
} | |||
} | |||
SCOPED_RAW_TIMER(&_write_memtable_time); | |||
ThreadCpuStopWatch cpu_time_stop_watch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得这个得加到async result writer 那个线程那里,这样所有的都被cover 住了
builder().column("BE_ID", ScalarType.createType(PrimitiveType.BIGINT)) | ||
.column("WORKLOAD_GROUP_ID", ScalarType.createType(PrimitiveType.BIGINT)) | ||
.column("MEMORY_USAGE_BYTES", ScalarType.createType(PrimitiveType.BIGINT)) | ||
.column("CPU_USAGE", ScalarType.createVarchar(256)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不把这列的类型定义为整数,这样用户可以排序。
然后把列名改成CPU_USAGE(%)这样
} | ||
_next_io_time_micros += ret < 1 ? static_cast<int64_t>(1) : static_cast<int64_t>(ret); | ||
(*_io_adder) << io_bytes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里我感觉local 的也统计了,那么之前的就没必要再那个宏里修改了,直接都用这里的统计
01770f9
to
01a500a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
185b865
to
8d689c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
7725bb5
to
f3f42f0
Compare
f3f42f0
to
3bffef3
Compare
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 39938 ms
|
TPC-DS: Total hot run time: 204326 ms
|
ClickBench: Total hot run time: 30.93 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. please add apache/doris-website's pr link in your pr content.
## Proposed changes ``` mysql [information_schema]>select BE_ID,WORKLOAD_GROUP_ID,CPU_USAGE,LOCAL_SCAN_BYTES_PER_SECOND/1024/1024 as scan_io_mb, MEMORY_USAGE_BYTES/1024/1024 mem_mb from workload_group_resource_usage; +-------+-------------------+-----------+--------------------+-------------------+ | BE_ID | WORKLOAD_GROUP_ID | CPU_USAGE | scan_io_mb | mem_mb | +-------+-------------------+-----------+--------------------+-------------------+ | 10005 | 62053 | 61.41% | 1516.4589414596558 | 27970.84313774109 | | 10005 | 1 | 0.00% | 0 | 0 | +-------+-------------------+-----------+--------------------+-------------------+ ```
## Proposed changes ``` mysql [information_schema]>select BE_ID,WORKLOAD_GROUP_ID,CPU_USAGE,LOCAL_SCAN_BYTES_PER_SECOND/1024/1024 as scan_io_mb, MEMORY_USAGE_BYTES/1024/1024 mem_mb from workload_group_resource_usage; +-------+-------------------+-----------+--------------------+-------------------+ | BE_ID | WORKLOAD_GROUP_ID | CPU_USAGE | scan_io_mb | mem_mb | +-------+-------------------+-----------+--------------------+-------------------+ | 10005 | 62053 | 61.41% | 1516.4589414596558 | 27970.84313774109 | | 10005 | 1 | 0.00% | 0 | 0 | +-------+-------------------+-----------+--------------------+-------------------+ ```
``` mysql [information_schema]>select BE_ID,WORKLOAD_GROUP_ID,CPU_USAGE,LOCAL_SCAN_BYTES_PER_SECOND/1024/1024 as scan_io_mb, MEMORY_USAGE_BYTES/1024/1024 mem_mb from workload_group_resource_usage; +-------+-------------------+-----------+--------------------+-------------------+ | BE_ID | WORKLOAD_GROUP_ID | CPU_USAGE | scan_io_mb | mem_mb | +-------+-------------------+-----------+--------------------+-------------------+ | 10005 | 62053 | 61.41% | 1516.4589414596558 | 27970.84313774109 | | 10005 | 1 | 0.00% | 0 | 0 | +-------+-------------------+-----------+--------------------+-------------------+ ```
``` mysql [information_schema]>select BE_ID,WORKLOAD_GROUP_ID,CPU_USAGE,LOCAL_SCAN_BYTES_PER_SECOND/1024/1024 as scan_io_mb, MEMORY_USAGE_BYTES/1024/1024 mem_mb from workload_group_resource_usage; +-------+-------------------+-----------+--------------------+-------------------+ | BE_ID | WORKLOAD_GROUP_ID | CPU_USAGE | scan_io_mb | mem_mb | +-------+-------------------+-----------+--------------------+-------------------+ | 10005 | 62053 | 61.41% | 1516.4589414596558 | 27970.84313774109 | | 10005 | 1 | 0.00% | 0 | 0 | +-------+-------------------+-----------+--------------------+-------------------+ ```
Proposed changes