Better test

This commit is contained in:
kssenii 2022-09-04 19:10:46 +02:00
parent 2dcf3fef94
commit 48dc32faf8
4 changed files with 4 additions and 8 deletions

View File

@ -98,7 +98,6 @@
M(CacheDetachedFileSegments, "Number of existing detached cache file segments") \ M(CacheDetachedFileSegments, "Number of existing detached cache file segments") \
M(FilesystemCacheSize, "Filesystem cache size in bytes") \ M(FilesystemCacheSize, "Filesystem cache size in bytes") \
M(FilesystemCacheElements, "Filesystem cache elements (file segments)") \ M(FilesystemCacheElements, "Filesystem cache elements (file segments)") \
M(BackgroundLoadingMarksTasks, "Number of currently executing background marks load tasks") \
M(S3Requests, "S3 requests") \ M(S3Requests, "S3 requests") \
M(KeeperAliveConnections, "Number of alive connections") \ M(KeeperAliveConnections, "Number of alive connections") \
M(KeeperOutstandingRequets, "Number of outstanding requests") \ M(KeeperOutstandingRequets, "Number of outstanding requests") \

View File

@ -147,6 +147,7 @@
M(SelectedBytes, "Number of bytes (uncompressed; for columns as they stored in memory) SELECTed from all tables.") \ M(SelectedBytes, "Number of bytes (uncompressed; for columns as they stored in memory) SELECTed from all tables.") \
\ \
M(WaitMarksLoadMicroseconds, "Time spent loading marks") \ M(WaitMarksLoadMicroseconds, "Time spent loading marks") \
M(BackgroundLoadingMarksTasks, "Number of background tasks for loading marks") \
\ \
M(Merge, "Number of launched background merges.") \ M(Merge, "Number of launched background merges.") \
M(MergedRows, "Rows read for background merges. This is the number of rows before merge.") \ M(MergedRows, "Rows read for background merges. This is the number of rows before merge.") \

View File

@ -9,14 +9,10 @@
#include <utility> #include <utility>
namespace CurrentMetrics
{
extern const Metric BackgroundLoadingMarksTasks;
}
namespace ProfileEvents namespace ProfileEvents
{ {
extern const Event WaitMarksLoadMicroseconds; extern const Event WaitMarksLoadMicroseconds;
extern const Event BackgroundLoadingMarksTasks;
} }
namespace DB namespace DB
@ -196,7 +192,7 @@ std::future<MarkCache::MappedPtr> MergeTreeMarksLoader::loadMarksAsync()
CurrentThread::detachQuery(); CurrentThread::detachQuery();
}); });
CurrentMetrics::Increment metric_increment{CurrentMetrics::BackgroundLoadingMarksTasks}; ProfileEvents::increment(ProfileEvents::BackgroundLoadingMarksTasks);
return loadMarks(); return loadMarks();
}); });

View File

@ -40,7 +40,7 @@ function test
else else
echo 'F' echo 'F'
fi 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 if [[ $result -ne 0 ]]; then
echo 'Ok' echo 'Ok'
else else