This commit is contained in:
Alexey Milovidov 2019-09-23 01:57:06 +03:00
parent ef61e3e27d
commit 70bc89557f
5 changed files with 15 additions and 15 deletions

View File

@ -21,7 +21,7 @@ MetricsTransmitter::MetricsTransmitter(
{
interval_seconds = config.getInt(config_name + ".interval", 60);
send_events = config.getBool(config_name + ".events", true);
send_events_absolute = config.getBool(config_name + ".events_absolute", false);
send_events_cumulative = config.getBool(config_name + ".events_cumulative", false);
send_metrics = config.getBool(config_name + ".metrics", true);
send_asynchronous_metrics = config.getBool(config_name + ".asynchronous_metrics", true);
}
@ -96,13 +96,13 @@ void MetricsTransmitter::transmit(std::vector<ProfileEvents::Count> & prev_count
}
}
if (send_events_absolute)
if (send_events_cumulative)
{
for (size_t i = 0, end = ProfileEvents::end(); i < end; ++i)
{
const auto counter = ProfileEvents::global_counters[i].load(std::memory_order_relaxed);
std::string key{ProfileEvents::getName(static_cast<ProfileEvents::Event>(i))};
key_vals.emplace_back(profile_events_absolute_path_prefix + key, counter);
key_vals.emplace_back(profile_events_cumulative_path_prefix + key, counter);
}
}

View File

@ -24,8 +24,8 @@ class AsynchronousMetrics;
/** Automatically sends
* - values deltas of ProfileEvents;
* - absolute values of ProfileEvents;
* - delta values of ProfileEvents;
* - cumulative values of ProfileEvents;
* - values of CurrentMetrics;
* - values of AsynchronousMetrics;
* to Graphite at beginning of every minute.
@ -45,7 +45,7 @@ private:
std::string config_name;
UInt32 interval_seconds;
bool send_events;
bool send_events_absolute;
bool send_events_cumulative;
bool send_metrics;
bool send_asynchronous_metrics;
@ -55,7 +55,7 @@ private:
ThreadFromGlobalPool thread{&MetricsTransmitter::run, this};
static inline constexpr auto profile_events_path_prefix = "ClickHouse.ProfileEvents.";
static inline constexpr auto profile_events_absolute_path_prefix = "ClickHouse.ProfileEventsAbsolute.";
static inline constexpr auto profile_events_cumulative_path_prefix = "ClickHouse.ProfileEventsCumulative.";
static inline constexpr auto current_metrics_path_prefix = "ClickHouse.Metrics.";
static inline constexpr auto asynchronous_metrics_path_prefix = "ClickHouse.AsynchronousMetrics.";
};

View File

@ -258,7 +258,7 @@
<metrics>true</metrics>
<events>true</events>
<events_absolute>false</events_absolute>
<events_cumulative>false</events_cumulative>
<asynchronous_metrics>true</asynchronous_metrics>
</graphite>
<graphite>
@ -270,7 +270,7 @@
<metrics>true</metrics>
<events>true</events>
<events_absolute>false</events_absolute>
<events_cumulative>false</events_cumulative>
<asynchronous_metrics>false</asynchronous_metrics>
</graphite>
-->

View File

@ -141,8 +141,8 @@ Settings:
- timeout The timeout for sending data, in seconds.
- root_path Prefix for keys.
- metrics Sending data from a :ref:`system_tables-system.metrics` table.
- events Sending deltas data from a :ref:`system_tables-system.events` table
- events_absolute Sending absolute data from a :ref:`system_tables-system.events` table
- events Sending deltas data accumulated for the time period from a :ref:`system_tables-system.events` table
- events_cumulative Sending cumulative data from a :ref:`system_tables-system.events` table
- asynchronous_metrics Sending data from a :ref:`system_tables-system.asynchronous_metrics` table.
You can configure multiple `<graphite>` clauses. For instance, you can use this for sending different data at different intervals.
@ -158,7 +158,7 @@ You can configure multiple `<graphite>` clauses. For instance, you can use this
<root_path>one_min</root_path>
<metrics>true</metrics>
<events>true</events>
<events_absolute>false</events_absolute>
<events_cumulative>false</events_cumulative>
<asynchronous_metrics>true</asynchronous_metrics>
</graphite>
```

View File

@ -140,8 +140,8 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
- timeout - Таймаут отправки данных в секундах.
- root_path - Префикс для ключей.
- metrics - Отправка данных из таблицы :ref:`system_tables-system.metrics`.
- events - Отправка дельты данных из таблицы :ref:`system_tables-system.events`
- events_absolute - Отправка абсолютных данных из таблицы :ref:`system_tables-system.events`
- events - Отправка дельты данных, накопленной за промежуток времени из таблицы :ref:`system_tables-system.events`
- events_cumulative - Отправка суммарных данных из таблицы :ref:`system_tables-system.events`
- asynchronous_metrics - Отправка данных из таблицы :ref:`system_tables-system.asynchronous_metrics`.
Можно определить несколько секций `<graphite>`, например, для передачи различных данных с различной частотой.
@ -157,7 +157,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
<root_path>one_min</root_path>
<metrics>true</metrics>
<events>true</events>
<events_absolute>false</events_absolute>
<events_cumulative>false</events_cumulative>
<asynchronous_metrics>true</asynchronous_metrics>
</graphite>
```