diff --git a/src/Common/CurrentMetrics.cpp b/src/Common/CurrentMetrics.cpp index 4c773048597..542c48148c8 100644 --- a/src/Common/CurrentMetrics.cpp +++ b/src/Common/CurrentMetrics.cpp @@ -78,6 +78,12 @@ M(BackupsThreadsActive, "Number of threads in thread pool for BACKUP running a task.") \ M(RestoreThreads, "Number of threads in the thread pool for RESTORE.") \ M(RestoreThreadsActive, "Number of threads in the thread pool for RESTORE running a task.") \ + M(MarksLoaderThreads, "Number of threads in thread pool for loading marks.") \ + M(MarksLoaderThreadsActive, "Number of threads in the thread pool for loading marks running a task.") \ + M(IOPrefetchThreads, "Number of threads in the IO prefertch thread pool.") \ + M(IOPrefetchThreadsActive, "Number of threads in the IO prefetch thread pool running a task.") \ + M(IOWriterThreads, "Number of threads in the IO writer thread pool.") \ + M(IOWriterThreadsActive, "Number of threads in the IO writer thread pool running a task.") \ M(IOThreads, "Number of threads in the IO thread pool.") \ M(IOThreadsActive, "Number of threads in the IO thread pool running a task.") \ M(ThreadPoolRemoteFSReaderThreads, "Number of threads in the thread pool for remote_filesystem_read_method=threadpool.") \ diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 82a8e43e8e2..522107dccc9 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -145,6 +145,12 @@ namespace CurrentMetrics extern const Metric BackgroundFetchesPoolSize; extern const Metric BackgroundCommonPoolTask; extern const Metric BackgroundCommonPoolSize; + extern const Metric MarksLoaderThreads; + extern const Metric MarksLoaderThreadsActive; + extern const Metric IOPrefetchThreads; + extern const Metric IOPrefetchThreadsActive; + extern const Metric IOWriterThreads; + extern const Metric IOWriterThreadsActive; } namespace DB @@ -2018,7 +2024,8 @@ ThreadPool & Context::getLoadMarksThreadpool() const { auto pool_size = config.getUInt(".load_marks_threadpool_pool_size", 50); auto queue_size = config.getUInt(".load_marks_threadpool_queue_size", 1000000); - shared->load_marks_threadpool = std::make_unique(pool_size, pool_size, queue_size); + shared->load_marks_threadpool = std::make_unique( + CurrentMetrics::MarksLoaderThreads, CurrentMetrics::MarksLoaderThreadsActive, pool_size, pool_size, queue_size); } return *shared->load_marks_threadpool; } @@ -2043,7 +2050,8 @@ ThreadPool & Context::getPrefetchThreadpool() const { auto pool_size = getPrefetchThreadpoolSize(); auto queue_size = config.getUInt(".prefetch_threadpool_queue_size", 1000000); - shared->prefetch_threadpool = std::make_unique(pool_size, pool_size, queue_size); + shared->prefetch_threadpool = std::make_unique( + CurrentMetrics::IOPrefetchThreads, CurrentMetrics::IOPrefetchThreadsActive, pool_size, pool_size, queue_size); } return *shared->prefetch_threadpool; } @@ -3967,7 +3975,8 @@ ThreadPool & Context::getThreadPoolWriter() const auto pool_size = config.getUInt(".threadpool_writer_pool_size", 100); auto queue_size = config.getUInt(".threadpool_writer_queue_size", 1000000); - shared->threadpool_writer = std::make_unique(pool_size, pool_size, queue_size); + shared->threadpool_writer = std::make_unique( + CurrentMetrics::IOWriterThreads, CurrentMetrics::IOWriterThreadsActive, pool_size, pool_size, queue_size); } return *shared->threadpool_writer; diff --git a/tests/queries/0_stateless/25402_projection_and_ast_optimizations_bug.reference b/tests/queries/0_stateless/02705_projection_and_ast_optimizations_bug.reference similarity index 100% rename from tests/queries/0_stateless/25402_projection_and_ast_optimizations_bug.reference rename to tests/queries/0_stateless/02705_projection_and_ast_optimizations_bug.reference diff --git a/tests/queries/0_stateless/25402_projection_and_ast_optimizations_bug.sql b/tests/queries/0_stateless/02705_projection_and_ast_optimizations_bug.sql similarity index 100% rename from tests/queries/0_stateless/25402_projection_and_ast_optimizations_bug.sql rename to tests/queries/0_stateless/02705_projection_and_ast_optimizations_bug.sql