mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Reverted system.events changes. Added docs for system.metrics. [#METR-239111]
This commit is contained in:
parent
07d720565c
commit
694b0fad97
@ -1,5 +1,4 @@
|
||||
#include <DB/Common/ProfileEvents.h>
|
||||
#include <DB/Common/CurrentMetrics.h>
|
||||
#include <DB/Columns/ColumnString.h>
|
||||
#include <DB/DataTypes/DataTypeString.h>
|
||||
#include <DB/DataTypes/DataTypesNumberFixed.h>
|
||||
@ -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<DataTypeInt8>()},
|
||||
{"event", std::make_shared<DataTypeString>()},
|
||||
{"value", std::make_shared<DataTypeUInt64>()}
|
||||
}
|
||||
@ -55,23 +46,8 @@ BlockInputStreams StorageSystemEvents::read(
|
||||
|
||||
if (0 != value)
|
||||
{
|
||||
size_t col = 0;
|
||||
block.unsafeGetByPosition(col++).column->insert(static_cast<Int64>(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<Int64>(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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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==
|
||||
|
||||
Содержит информацию о доступных в конфигурационном файле кластерах и серверах, которые в них входят.
|
||||
|
Loading…
Reference in New Issue
Block a user