From 694b0fad971b4c0518780c1a3847e7a0639c5a03 Mon Sep 17 00:00:00 2001 From: Vitaliy Lyudvichenko Date: Sat, 31 Dec 2016 03:06:23 +0300 Subject: [PATCH] Reverted system.events changes. Added docs for system.metrics. [#METR-239111] --- .../Storages/System/StorageSystemEvents.cpp | 28 ++----------------- doc/reference_en.html | 5 ++++ doc/reference_ru.html | 8 ++++++ 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/dbms/src/Storages/System/StorageSystemEvents.cpp b/dbms/src/Storages/System/StorageSystemEvents.cpp index 41db0a23275..7541c75c056 100644 --- a/dbms/src/Storages/System/StorageSystemEvents.cpp +++ b/dbms/src/Storages/System/StorageSystemEvents.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -11,18 +10,10 @@ namespace DB { -enum class EventType -{ - ProfileEvent = 0, - CurrentMetric = 1 -}; - - StorageSystemEvents::StorageSystemEvents(const std::string & name_) : name(name_), columns { - {"type", std::make_shared()}, {"event", std::make_shared()}, {"value", std::make_shared()} } @@ -55,23 +46,8 @@ BlockInputStreams StorageSystemEvents::read( if (0 != value) { - size_t col = 0; - block.unsafeGetByPosition(col++).column->insert(static_cast(EventType::ProfileEvent)); - block.unsafeGetByPosition(col++).column->insert(String(ProfileEvents::getDescription(ProfileEvents::Event(i)))); - block.unsafeGetByPosition(col++).column->insert(value); - } - } - - for (size_t i = 0, end = CurrentMetrics::end(); i < end; ++i) - { - UInt64 value = CurrentMetrics::values[i]; - - if (0 != value) - { - size_t col = 0; - block.unsafeGetByPosition(col++).column->insert(static_cast(EventType::CurrentMetric)); - block.unsafeGetByPosition(col++).column->insert(String(CurrentMetrics::getDescription(CurrentMetrics::Metric(i)))); - block.unsafeGetByPosition(col++).column->insert(value); + block.unsafeGetByPosition(0).column->insert(String(ProfileEvents::getDescription(ProfileEvents::Event(i)))); + block.unsafeGetByPosition(1).column->insert(value); } } diff --git a/doc/reference_en.html b/doc/reference_en.html index 8a482a50fe8..8ab3e303eec 100644 --- a/doc/reference_en.html +++ b/doc/reference_en.html @@ -3138,6 +3138,11 @@ Contains information about the number of events that have occurred in the system Example: The number of processed SELECT queries. Columns: 'event String' - the event name, and 'value UInt64' - the quantity. +==system.metrics== +==system.asynchronous_metrics== +Like system.events, but show info about currently executing events or consuming resources. +Example: The number of currently executing SELECT queries; memory consumption of the system. + ==system.clusters== Contains information about clusters available in the config file and the servers in them. diff --git a/doc/reference_ru.html b/doc/reference_ru.html index 7319a262e7b..7912218b828 100644 --- a/doc/reference_ru.html +++ b/doc/reference_ru.html @@ -3201,6 +3201,14 @@ query_id String - идентификатор запроса, если Пример: количество обработанных запросов типа SELECT. Столбцы: event String - имя события, value UInt64 - количество. +==system.metrics== +==system.asynchronous_metrics== + +Содержат метрики, используемые для профилирования и мониторинга. +Обычно отражают количество событий, происходящих в данный момент в системе, или ресурсов, суммарно потребляемых системой. +Пример: количество запросов типа SELECT, исполняемых в текущий момент; количество потребляемой памяти. +system.asynchronous_metrics и system.metrics отличаются набором и способом вычисления метрик. + ==system.clusters== Содержит информацию о доступных в конфигурационном файле кластерах и серверах, которые в них входят.