diff --git a/src/Common/CurrentMetrics.cpp b/src/Common/CurrentMetrics.cpp index 9e5f3705dad..eeb8b4e2832 100644 --- a/src/Common/CurrentMetrics.cpp +++ b/src/Common/CurrentMetrics.cpp @@ -98,7 +98,6 @@ M(CacheDetachedFileSegments, "Number of existing detached cache file segments") \ M(FilesystemCacheSize, "Filesystem cache size in bytes") \ M(FilesystemCacheElements, "Filesystem cache elements (file segments)") \ - M(BackgroundLoadingMarksTasks, "Number of currently executing background marks load tasks") \ M(S3Requests, "S3 requests") \ M(KeeperAliveConnections, "Number of alive connections") \ M(KeeperOutstandingRequets, "Number of outstanding requests") \ diff --git a/src/Common/ProfileEvents.cpp b/src/Common/ProfileEvents.cpp index dd35220d945..183a06b6610 100644 --- a/src/Common/ProfileEvents.cpp +++ b/src/Common/ProfileEvents.cpp @@ -147,6 +147,7 @@ M(SelectedBytes, "Number of bytes (uncompressed; for columns as they stored in memory) SELECTed from all tables.") \ \ M(WaitMarksLoadMicroseconds, "Time spent loading marks") \ + M(BackgroundLoadingMarksTasks, "Number of background tasks for loading marks") \ \ M(Merge, "Number of launched background merges.") \ M(MergedRows, "Rows read for background merges. This is the number of rows before merge.") \ diff --git a/src/Storages/MergeTree/MergeTreeMarksLoader.cpp b/src/Storages/MergeTree/MergeTreeMarksLoader.cpp index 67bc5deba49..27100f8f474 100644 --- a/src/Storages/MergeTree/MergeTreeMarksLoader.cpp +++ b/src/Storages/MergeTree/MergeTreeMarksLoader.cpp @@ -9,14 +9,10 @@ #include -namespace CurrentMetrics -{ - extern const Metric BackgroundLoadingMarksTasks; -} - namespace ProfileEvents { extern const Event WaitMarksLoadMicroseconds; + extern const Event BackgroundLoadingMarksTasks; } namespace DB @@ -196,7 +192,7 @@ std::future MergeTreeMarksLoader::loadMarksAsync() CurrentThread::detachQuery(); }); - CurrentMetrics::Increment metric_increment{CurrentMetrics::BackgroundLoadingMarksTasks}; + ProfileEvents::increment(ProfileEvents::BackgroundLoadingMarksTasks); return loadMarks(); }); diff --git a/tests/queries/0_stateless/02417_load_marks_async.sh b/tests/queries/0_stateless/02417_load_marks_async.sh index 71d7fdfd173..310258e6b3a 100755 --- a/tests/queries/0_stateless/02417_load_marks_async.sh +++ b/tests/queries/0_stateless/02417_load_marks_async.sh @@ -40,7 +40,7 @@ function test else echo 'F' fi - result=$(${CLICKHOUSE_CLIENT} -q "WITH CurrentMetric_BackgroundLoadingMarksTasks as a SELECT count(a) FROM system.metric_log WHERE a > 0") + result=$(${CLICKHOUSE_CLIENT} -q "SELECT ProfileEvents['BackgroundLoadingMarksTasks'] FROM system.query_log WHERE query_id = '${QUERY_ID}' AND type = 'QueryFinish' AND current_database = currentDatabase()") if [[ $result -ne 0 ]]; then echo 'Ok' else