mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
CurrentMetrics/Increment: Introduce add()
This commit is contained in:
parent
017c054a35
commit
70049db143
@ -100,6 +100,12 @@ namespace CurrentMetrics
|
||||
amount -= value;
|
||||
}
|
||||
|
||||
void add(Value value = 1)
|
||||
{
|
||||
what->fetch_add(value, std::memory_order_relaxed);
|
||||
amount += value;
|
||||
}
|
||||
|
||||
/// Subtract value before destructor.
|
||||
void destroy()
|
||||
{
|
||||
|
@ -758,8 +758,7 @@ bool StorageDistributedDirectoryMonitor::addAndSchedule(size_t file_size, size_t
|
||||
|
||||
{
|
||||
std::lock_guard metrics_lock(metrics_mutex);
|
||||
/// TODO: extend CurrentMetrics::Increment
|
||||
metric_pending_files.sub(-1);
|
||||
metric_pending_files.add();
|
||||
bytes_count += file_size;
|
||||
++files_count;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user