[Refactor]Refactor workload group metric#46640
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
| @@ -36,35 +43,23 @@ WorkloadGroupMetrics::WorkloadGroupMetrics(WorkloadGroup* wg) { | |||
| _entity = DorisMetrics::instance()->metric_registry()->register_entity( | |||
| "workload_group." + std::to_string(wg->id()), {{"workload_group", wg->name()}}); | |||
There was a problem hiding this comment.
对于重复创建的同名的wg,这里的 wg->id() 是否会一样?
| std::shared_ptr<MetricEntity> io_entity = | ||
| DorisMetrics::instance()->metric_registry()->register_entity( | ||
| data_dir_metric_name, | ||
| {{"workload_group", wg->name()}, {"path", data_dir.metric_name}}); |
There was a problem hiding this comment.
对于重复创建的同名的 wg,这里是否会生成具有相同 name 以及 label 的entity?
There was a problem hiding this comment.
维度肯定会重复啊,名字都一样,但是注册entity的data_dir_metric_name不会,因为data_dir_metric_name离包含了workload group的id的
| std::atomic<uint64_t> _memory_used {0}; | ||
|
|
||
| std::shared_ptr<MetricEntity> _entity {nullptr}; | ||
| std::vector<std::shared_ptr<MetricEntity>> _io_entity_list; |
There was a problem hiding this comment.
Why shared_ptr? may be unique_ptr is enough.
There was a problem hiding this comment.
register_entity returns shared_ptr
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 32886 ms |
TPC-DS: Total hot run time: 194693 ms |
ClickBench: Total hot run time: 31.31 s |
273e822 to
36b4a3a
Compare
|
run buildall |
TPC-H: Total hot run time: 32216 ms |
TPC-DS: Total hot run time: 187492 ms |
ClickBench: Total hot run time: 31.53 s |
|
TeamCity be ut coverage result: |
|
PR approved by anyone and no changes requested. |
|
PR approved by at least one committer and no changes requested. |
What problem does this PR solve?
before:
after
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)