Added a metric for the number of files to send in Distributed tables

This commit is contained in:
Alexey Milovidov 2019-08-22 04:30:49 +03:00
parent a7fa71aaf1
commit 6bbf3bd634
2 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,7 @@
M(GlobalThreadActive, "Number of threads in global thread pool running a task.") \
M(LocalThread, "Number of threads in local thread pools. Should be similar to GlobalThreadActive.") \
M(LocalThreadActive, "Number of threads in local thread pools running a task.") \
M(DistributedFilesToInsert, "Number of pending files to process for asynchronous insertion into Distributed tables. Number of files for every shard is summed.") \
namespace CurrentMetrics

View File

@ -23,6 +23,7 @@
namespace CurrentMetrics
{
extern const Metric DistributedSend;
extern const Metric DistributedFilesToInsert;
}
namespace DB
@ -209,6 +210,8 @@ bool StorageDistributedDirectoryMonitor::processFiles()
if (files.empty())
return false;
CurrentMetrics::Increment metric_increment{CurrentMetrics::DistributedFilesToInsert, CurrentMetrics::Value(files.size())};
if (should_batch_inserts)
{
processFilesWithBatching(files);