Skip to content

Commit

Permalink
[refactor](metrics) Remove IntAtomicCounter & CoreLocal #45742 (#45871)
Browse files Browse the repository at this point in the history
cherry pick from #45742
  • Loading branch information
zhiqiang-hhhh authored Dec 24, 2024
1 parent fc2f65d commit 3432361
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 626 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 @@ -589,10 +589,10 @@ ShardedLRUCache::ShardedLRUCache(const std::string& name, size_t capacity, LRUCa
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 @@ -442,8 +442,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.

22 changes: 11 additions & 11 deletions be/src/util/doris_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,17 @@ DorisMetrics::DorisMetrics() : _metric_registry(_s_registry_name) {
INT_GAUGE_METRIC_REGISTER(_server_metric_entity, broker_file_open_reading);
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, num_io_bytes_read_total);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_cache);
INT_ATOMIC_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_remote);

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, num_io_bytes_read_total);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_cache);
INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_remote);

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
22 changes: 11 additions & 11 deletions be/src/util/doris_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,17 @@ class DorisMetrics {
UIntGauge* group_local_scan_thread_pool_queue_size = nullptr;
UIntGauge* group_local_scan_thread_pool_thread_num = nullptr;

IntAtomicCounter* num_io_bytes_read_total = nullptr;
IntAtomicCounter* num_io_bytes_read_from_cache = nullptr;
IntAtomicCounter* num_io_bytes_read_from_remote = 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* num_io_bytes_read_total = nullptr;
IntCounter* num_io_bytes_read_from_cache = nullptr;
IntCounter* num_io_bytes_read_from_remote = 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 3432361

Please sign in to comment.