Skip to content

Commit

Permalink
[refactor](metrics) Remove IntAtomicCounter & CoreLocal (apache#45742)
Browse files Browse the repository at this point in the history
1. Remove `IntAtomicCounter`, it is equal to `IntCounter`.
2. Remove `CoreLocal` related code. It is not used any more.
  • Loading branch information
zhiqiang-hhhh committed Dec 24, 2024
1 parent c9d3f11 commit 3c98f92
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 618 deletions.
8 changes: 4 additions & 4 deletions be/src/olap/lru_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,10 @@ ShardedLRUCache::ShardedLRUCache(const std::string& name, size_t total_capacity,
INT_GAUGE_METRIC_REGISTER(_entity, cache_capacity);
INT_GAUGE_METRIC_REGISTER(_entity, cache_usage);
INT_GAUGE_METRIC_REGISTER(_entity, cache_element_count);
INT_DOUBLE_METRIC_REGISTER(_entity, cache_usage_ratio);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_entity, cache_lookup_count);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_entity, cache_hit_count);
INT_DOUBLE_METRIC_REGISTER(_entity, cache_hit_ratio);
DOUBLE_GAUGE_METRIC_REGISTER(_entity, cache_usage_ratio);
INT_COUNTER_METRIC_REGISTER(_entity, cache_lookup_count);
INT_COUNTER_METRIC_REGISTER(_entity, cache_hit_count);
DOUBLE_GAUGE_METRIC_REGISTER(_entity, cache_hit_ratio);

_hit_count_bvar.reset(new bvar::Adder<uint64_t>("doris_cache", _name));
_hit_count_per_second.reset(new bvar::PerSecond<bvar::Adder<uint64_t>>(
Expand Down
4 changes: 2 additions & 2 deletions be/src/olap/lru_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ class ShardedLRUCache : public Cache {
IntGauge* cache_usage = nullptr;
IntGauge* cache_element_count = nullptr;
DoubleGauge* cache_usage_ratio = nullptr;
IntAtomicCounter* cache_lookup_count = nullptr;
IntAtomicCounter* cache_hit_count = nullptr;
IntCounter* cache_lookup_count = nullptr;
IntCounter* cache_hit_count = nullptr;
DoubleGauge* cache_hit_ratio = nullptr;
// bvars
std::unique_ptr<bvar::Adder<uint64_t>> _hit_count_bvar;
Expand Down
129 changes: 0 additions & 129 deletions be/src/util/core_local.cpp

This file was deleted.

162 changes: 0 additions & 162 deletions be/src/util/core_local.h

This file was deleted.

14 changes: 7 additions & 7 deletions be/src/util/doris_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ DorisMetrics::DorisMetrics() : _metric_registry(_s_registry_name) {
INT_GAUGE_METRIC_REGISTER(_server_metric_entity, local_file_open_writing);
INT_GAUGE_METRIC_REGISTER(_server_metric_entity, s3_file_open_writing);

INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, query_ctx_cnt);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_ctx_cnt);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_cnt);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_cnt);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_queued);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_running);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_submit_failed);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_ctx_cnt);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_ctx_cnt);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_cnt);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_cnt);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_queued);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_running);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_submit_failed);
}

void DorisMetrics::initialize(bool init_system_metrics, const std::set<std::string>& disk_devices,
Expand Down
14 changes: 7 additions & 7 deletions be/src/util/doris_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ class DorisMetrics {
UIntGauge* group_local_scan_thread_pool_queue_size = nullptr;
UIntGauge* group_local_scan_thread_pool_thread_num = nullptr;

IntAtomicCounter* query_ctx_cnt = nullptr;
IntAtomicCounter* scanner_ctx_cnt = nullptr;
IntAtomicCounter* scanner_cnt = nullptr;
IntAtomicCounter* scanner_task_cnt = nullptr;
IntAtomicCounter* scanner_task_queued = nullptr;
IntAtomicCounter* scanner_task_submit_failed = nullptr;
IntAtomicCounter* scanner_task_running = nullptr;
IntCounter* query_ctx_cnt = nullptr;
IntCounter* scanner_ctx_cnt = nullptr;
IntCounter* scanner_cnt = nullptr;
IntCounter* scanner_task_cnt = nullptr;
IntCounter* scanner_task_queued = nullptr;
IntCounter* scanner_task_submit_failed = nullptr;
IntCounter* scanner_task_running = nullptr;

static DorisMetrics* instance() {
static DorisMetrics instance;
Expand Down
Loading

0 comments on commit 3c98f92

Please sign in to comment.