DOCAPI-3825: System tables. EN review, RU translation. (#6088)

This commit is contained in:
BayoNet 2019-07-31 08:09:13 +03:00 committed by Ivan Blinkov
parent b103137280
commit cf746c3eed
4 changed files with 138 additions and 48 deletions

View File

@ -6,13 +6,13 @@
M(Query, "Number of executing queries") \ M(Query, "Number of executing queries") \
M(Merge, "Number of executing background merges") \ M(Merge, "Number of executing background merges") \
M(PartMutation, "Number of mutations (ALTER DELETE/UPDATE)") \ M(PartMutation, "Number of mutations (ALTER DELETE/UPDATE)") \
M(ReplicatedFetch, "Number of data parts fetching from replica") \ M(ReplicatedFetch, "Number of data parts being fetched from replica") \
M(ReplicatedSend, "Number of data parts sending to replicas") \ M(ReplicatedSend, "Number of data parts being sent to replicas") \
M(ReplicatedChecks, "Number of data parts checking for consistency") \ M(ReplicatedChecks, "Number of data parts checking for consistency") \
M(BackgroundPoolTask, "Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches or replication queue bookkeeping)") \ M(BackgroundPoolTask, "Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping)") \
M(BackgroundSchedulePoolTask, "Number of active tasks in BackgroundSchedulePool. This pool is used for periodic tasks of ReplicatedMergeTree like cleaning old data parts, altering data parts, replica re-initialization, etc.") \ M(BackgroundSchedulePoolTask, "Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc.") \
M(DiskSpaceReservedForMerge, "Disk space reserved for currently running background merges. It is slightly more than total size of currently merging parts.") \ M(DiskSpaceReservedForMerge, "Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts.") \
M(DistributedSend, "Number of connections sending data, that was INSERTed to Distributed tables, to remote servers. Both synchronous and asynchronous mode.") \ M(DistributedSend, "Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode.") \
M(QueryPreempted, "Number of queries that are stopped and waiting due to 'priority' setting.") \ M(QueryPreempted, "Number of queries that are stopped and waiting due to 'priority' setting.") \
M(TCPConnection, "Number of connections to TCP server (clients with native interface)") \ M(TCPConnection, "Number of connections to TCP server (clients with native interface)") \
M(HTTPConnection, "Number of connections to HTTP server") \ M(HTTPConnection, "Number of connections to HTTP server") \

View File

@ -5,14 +5,14 @@
/// Available events. Add something here as you wish. /// Available events. Add something here as you wish.
#define APPLY_FOR_EVENTS(M) \ #define APPLY_FOR_EVENTS(M) \
M(Query, "Number of queries started to be interpreted and maybe executed. Does not include queries that are failed to parse, that are rejected due to AST size limits; rejected due to quota limits or limits on number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.") \ M(Query, "Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.") \
M(SelectQuery, "Same as Query, but only for SELECT queries.") \ M(SelectQuery, "Same as Query, but only for SELECT queries.") \
M(InsertQuery, "Same as Query, but only for INSERT queries.") \ M(InsertQuery, "Same as Query, but only for INSERT queries.") \
M(FileOpen, "Number of files opened.") \ M(FileOpen, "Number of files opened.") \
M(Seek, "Number of times the 'lseek' function was called.") \ M(Seek, "Number of times the 'lseek' function was called.") \
M(ReadBufferFromFileDescriptorRead, "Number of reads (read/pread) from a file descriptor. Does not include sockets.") \ M(ReadBufferFromFileDescriptorRead, "Number of reads (read/pread) from a file descriptor. Does not include sockets.") \
M(ReadBufferFromFileDescriptorReadFailed, "Number of times the read (read/pread) from a file descriptor have failed.") \ M(ReadBufferFromFileDescriptorReadFailed, "Number of times the read (read/pread) from a file descriptor have failed.") \
M(ReadBufferFromFileDescriptorReadBytes, "Number of bytes read from file descriptors. If the file is compressed, this will show compressed data size.") \ M(ReadBufferFromFileDescriptorReadBytes, "Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size.") \
M(WriteBufferFromFileDescriptorWrite, "Number of writes (write/pwrite) to a file descriptor. Does not include sockets.") \ M(WriteBufferFromFileDescriptorWrite, "Number of writes (write/pwrite) to a file descriptor. Does not include sockets.") \
M(WriteBufferFromFileDescriptorWriteFailed, "Number of times the write (write/pwrite) to a file descriptor have failed.") \ M(WriteBufferFromFileDescriptorWriteFailed, "Number of times the write (write/pwrite) to a file descriptor have failed.") \
M(WriteBufferFromFileDescriptorWriteBytes, "Number of bytes written to file descriptors. If the file is compressed, this will show compressed data size.") \ M(WriteBufferFromFileDescriptorWriteBytes, "Number of bytes written to file descriptors. If the file is compressed, this will show compressed data size.") \

View File

@ -8,12 +8,12 @@ They are located in the 'system' database.
## system.asynchronous_metrics {#system_tables-asynchronous_metrics} ## system.asynchronous_metrics {#system_tables-asynchronous_metrics}
Contains metrics which are calculated periodically in background. For example, the amount of RAM in use. Contains metrics that are calculated periodically in the background. For example, the amount of RAM in use.
Columns: Columns:
- `metric` ([String](../data_types/string.md)) — Metric's name. - `metric` ([String](../data_types/string.md)) — Metric name.
- `value` ([Float64](../data_types/float.md)) — Metric's value. - `value` ([Float64](../data_types/float.md)) — Metric value.
**Example** **Example**
@ -40,7 +40,7 @@ SELECT * FROM system.asynchronous_metrics LIMIT 10
- [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring. - [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring.
- [system.metrics](#system_tables-metrics) — Contains instantly calculated metrics. - [system.metrics](#system_tables-metrics) — Contains instantly calculated metrics.
- [system.events](#system_tables-events) — Contains a number of happened events. - [system.events](#system_tables-events) — Contains a number of events that have occurred.
## system.clusters ## system.clusters
@ -48,7 +48,7 @@ Contains information about clusters available in the config file and the servers
Columns: Columns:
``` ```
cluster String — The cluster name. cluster String — The cluster name.
shard_num UInt32 — The shard number in the cluster, starting from 1. shard_num UInt32 — The shard number in the cluster, starting from 1.
shard_weight UInt32 — The relative weight of the shard when writing data. shard_weight UInt32 — The relative weight of the shard when writing data.
replica_num UInt32 — The replica number in the shard, starting from 1. replica_num UInt32 — The replica number in the shard, starting from 1.
@ -119,13 +119,13 @@ Note that the amount of memory used by the dictionary is not proportional to the
## system.events {#system_tables-events} ## system.events {#system_tables-events}
Contains information about the number of events that have occurred in the system. For example, in the table, you can find how many `SELECT` queries are processed from the moment of ClickHouse server start. Contains information about the number of events that have occurred in the system. For example, in the table, you can find how many `SELECT` queries were processed since the ClickHouse server started.
Columns: Columns:
- `event` ([String](../data_types/string.md)) — Event name. - `event` ([String](../data_types/string.md)) — Event name.
- `value` ([UInt64](../data_types/int_uint.md)) — Count of events occurred. - `value` ([UInt64](../data_types/int_uint.md)) — Number of events occurred.
- `description` ([String](../data_types/string.md)) — Description of an event. - `description` ([String](../data_types/string.md)) — Event description.
**Example** **Example**
@ -135,11 +135,11 @@ SELECT * FROM system.events LIMIT 5
```text ```text
┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ ┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Query │ 12 │ Number of queries started to be interpreted and maybe executed. Does not include queries that are failed to parse, that are rejected due to AST size limits; rejected due to quota limits or limits on number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries. │ │ Query │ 12 │ Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.
│ SelectQuery │ 8 │ Same as Query, but only for SELECT queries. │ │ SelectQuery │ 8 │ Same as Query, but only for SELECT queries. │
│ FileOpen │ 73 │ Number of files opened. │ │ FileOpen │ 73 │ Number of files opened. │
│ ReadBufferFromFileDescriptorRead │ 155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets. │ │ ReadBufferFromFileDescriptorRead │ 155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets. │
│ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show compressed data size. │ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size. │
└───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ └───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
``` ```
@ -197,13 +197,13 @@ Columns:
## system.metrics {#system_tables-metrics} ## system.metrics {#system_tables-metrics}
Contains metrics which can be calculated instantly, or have an current value. For example, a number of simultaneously processed queries, the current value for replica delay. This table is always up to date. Contains metrics which can be calculated instantly, or have a current value. For example, the number of simultaneously processed queries or the current replica delay. This table is always up to date.
Columns: Columns:
- `metric` ([String](../data_types/string.md)) — Metric's name. - `metric` ([String](../data_types/string.md)) — Metric name.
- `value` ([Int64](../data_types/int_uint.md)) — Metric's value. - `value` ([Int64](../data_types/int_uint.md)) — Metric value.
- `description` ([String](../data_types/string.md)) — Description of the metric. - `description` ([String](../data_types/string.md)) — Metric description.
**Example** **Example**
@ -216,19 +216,19 @@ SELECT * FROM system.metrics LIMIT 10
│ Query │ 1 │ Number of executing queries │ │ Query │ 1 │ Number of executing queries │
│ Merge │ 0 │ Number of executing background merges │ │ Merge │ 0 │ Number of executing background merges │
│ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │ │ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │
│ ReplicatedFetch │ 0 │ Number of data parts fetching from replica │ ReplicatedFetch │ 0 │ Number of data parts being fetched from replicas
│ ReplicatedSend │ 0 │ Number of data parts sending to replicas │ ReplicatedSend │ 0 │ Number of data parts being sent to replicas
│ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │ │ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │
│ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches or replication queue bookkeeping) │ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping) │
│ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic tasks of ReplicatedMergeTree like cleaning old data parts, altering data parts, replica re-initialization, etc. │ │ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc.
│ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than total size of currently merging parts. │ │ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts. │
│ DistributedSend │ 0 │ Number of connections sending data, that was INSERTed to Distributed tables, to remote servers. Both synchronous and asynchronous mode. │ │ DistributedSend │ 0 │ Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode. │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ └────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
``` ```
**See Also** **See Also**
- [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — Contains periodically calculated metrics. - [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — Contains periodically calculated metrics.
- [system.events](#system_tables-events) — Contains a umber of happened events. - [system.events](#system_tables-events) — Contains a number of events that occurred.
- [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring. - [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring.
## system.numbers ## system.numbers
@ -368,7 +368,7 @@ To enable query logging, set the parameter [log_queries](settings/settings.md#se
The `system.query_log` table registers two kinds of queries: The `system.query_log` table registers two kinds of queries:
1. Initial queries, that were run directly by the client. 1. Initial queries, that were run directly by the client.
2. Child queries that were initiated by other queries (for distributed query execution). For such a kind of queries, information about the parent queries is shown in the `initial_*` columns. 2. Child queries that were initiated by other queries (for distributed query execution). For such queries, information about parent queries is shown in the `initial_*` columns.
Columns: Columns:
@ -391,9 +391,7 @@ Columns:
- `query` (String) — Query string. - `query` (String) — Query string.
- `exception` (String) — Exception message. - `exception` (String) — Exception message.
- `stack_trace` (String) — Stack trace (a list of methods called before the error occurred). An empty string, if the query is completed successfully. - `stack_trace` (String) — Stack trace (a list of methods called before the error occurred). An empty string, if the query is completed successfully.
- `is_initial_query` (UInt8) — Kind of query. Possible values: - `is_initial_query` (UInt8) — Flag that indicates whether the query is initiated by the client (1), or by another query for distributed query execution (0).
- 1 — Query was initiated by the client.
- 0 — Query was initiated by another query for distributed query execution.
- `user` (String) — Name of the user initiated the current query. - `user` (String) — Name of the user initiated the current query.
- `query_id` (String) — ID of the query. - `query_id` (String) — ID of the query.
- `address` (FixedString(16)) — IP address the query was initiated from. - `address` (FixedString(16)) — IP address the query was initiated from.

View File

@ -8,10 +8,39 @@
## system.asynchronous_metrics {#system_tables-asynchronous_metrics} ## system.asynchronous_metrics {#system_tables-asynchronous_metrics}
Содержат метрики, используемые для профилирования и мониторинга. Содержит метрики, которые периодически вычисляются в фоновом режиме. Например, объем используемой оперативной памяти.
Обычно отражают количество событий, происходящих в данный момент в системе, или ресурсов, суммарно потребляемых системой.
Пример: количество запросов типа SELECT, исполняемых в текущий момент; количество потребляемой памяти. Столбцы:
`system.asynchronous_metrics` и `system.metrics` отличаются набором и способом вычисления метрик.
- `metric` ([String](../data_types/string.md)) — название метрики.
- `value` ([Float64](../data_types/float.md)) — значение метрики.
**Пример**
```sql
SELECT * FROM system.asynchronous_metrics LIMIT 10
```
```text
┌─metric──────────────────────────────────┬──────value─┐
│ jemalloc.background_thread.run_interval │ 0 │
│ jemalloc.background_thread.num_runs │ 0 │
│ jemalloc.background_thread.num_threads │ 0 │
│ jemalloc.retained │ 422551552 │
│ jemalloc.mapped │ 1682989056 │
│ jemalloc.resident │ 1656446976 │
│ jemalloc.metadata_thp │ 0 │
│ jemalloc.metadata │ 10226856 │
│ UncompressedCacheCells │ 0 │
│ MarkCacheFiles │ 0 │
└─────────────────────────────────────────┴────────────┘
```
**Смотрите также**
- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse.
- [system.metrics](#system_tables-metrics) — таблица с мгновенно вычисляемыми метриками.
- [system.events](#system_tables-events) — таблица с количеством произошедших событий.
## system.clusters ## system.clusters
@ -19,15 +48,16 @@
Столбцы: Столбцы:
``` ```
cluster String - имя кластера cluster String — имя кластера.
shard_num UInt32 - номер шарда в кластере, начиная с 1 shard_num UInt32 номер шарда в кластере, начиная с 1.
shard_weight UInt32 - относительный вес шарда при записи данных shard_weight UInt32 относительный вес шарда при записи данных
replica_num UInt32 - номер реплики в шарде, начиная с 1 replica_num UInt32 номер реплики в шарде, начиная с 1.
host_name String - имя хоста, как прописано в конфиге host_name String — хост, указанный в конфигурации.
host_address String - IP-адрес хоста, полученный из DNS host_address String IP-адрес хоста, полученный из DNS.
port UInt16 - порт, на который обращаться для соединения с сервером port UInt16 порт, на который обращаться для соединения с сервером.
user String - имя пользователя, которого использовать для соединения с сервером user String имя пользователя, которого использовать для соединения с сервером.
``` ```
## system.columns ## system.columns
Содержит информацию о столбцах всех таблиц. Содержит информацию о столбцах всех таблиц.
@ -72,9 +102,35 @@ default_expression String - выражение для значения по ум
## system.events {#system_tables-events} ## system.events {#system_tables-events}
Содержит информацию о количестве произошедших в системе событий, для профилирования и мониторинга. Содержит информацию о количестве событий, произошедших в системе. Например, в таблице можно найти, сколько запросов `SELECT` обработано с момента запуска сервера ClickHouse.
Пример: количество обработанных запросов типа SELECT.
Столбцы: event String - имя события, value UInt64 - количество. Столбцы:
- `event` ([String](../data_types/string.md)) — имя события.
- `value` ([UInt64](../data_types/int_uint.md)) — количество произошедших событий.
- `description` ([String](../data_types/string.md)) — описание события.
**Пример**
```sql
SELECT * FROM system.events LIMIT 5
```
```text
┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Query │ 12 │ Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries. │
│ SelectQuery │ 8 │ Same as Query, but only for SELECT queries. │
│ FileOpen │ 73 │ Number of files opened. │
│ ReadBufferFromFileDescriptorRead │ 155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets. │
│ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size. │
└───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
**Смотрите также**
- [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — таблица с периодически вычисляемыми метриками.
- [system.metrics](#system_tables-metrics) — таблица с мгновенно вычисляемыми метриками.
- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse.
## system.functions ## system.functions
@ -123,11 +179,47 @@ default_expression String - выражение для значения по ум
## system.metrics {#system_tables-metrics} ## system.metrics {#system_tables-metrics}
Содержит метрики, которые могут быть рассчитаны мгновенно или имеют текущее значение. Например, число одновременно обрабатываемых запросов или текущее значение задержки реплики. Эта таблица всегда актуальна.
Столбцы:
- `metric` ([String](../data_types/string.md)) — название метрики.
- `value` ([Int64](../data_types/int_uint.md)) — значение метрики.
- `description` ([String](../data_types/string.md)) — описание метрики.
**Пример**
```sql
SELECT * FROM system.metrics LIMIT 10
```
```text
┌─metric─────────────────────┬─value─┬─description──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Query │ 1 │ Number of executing queries │
│ Merge │ 0 │ Number of executing background merges │
│ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │
│ ReplicatedFetch │ 0 │ Number of data parts being fetched from replicas │
│ ReplicatedSend │ 0 │ Number of data parts being sent to replicas │
│ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │
│ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping) │
│ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc. │
│ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts. │
│ DistributedSend │ 0 │ Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode. │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
**Смотрите также**
- [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — таблица с периодически вычисляемыми метриками.
- [system.events](#system_tables-events) — таблица с количеством произошедших событий.
- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse.
## system.numbers ## system.numbers
Таблица содержит один столбец с именем number типа UInt64, содержащим почти все натуральные числа, начиная с нуля. Таблица содержит один столбец с именем number типа UInt64, содержащим почти все натуральные числа, начиная с нуля.
Эту таблицу можно использовать для тестов, а также если вам нужно сделать перебор. Эту таблицу можно использовать для тестов, а также если вам нужно сделать перебор.
Чтения из этой таблицы не распараллеливаются. Чтения из этой таблицы не распараллеливаются.
## system.numbers_mt ## system.numbers_mt
То же самое, что и system.numbers, но чтение распараллеливается. Числа могут возвращаться в произвольном порядке. То же самое, что и system.numbers, но чтение распараллеливается. Числа могут возвращаться в произвольном порядке.