Help wanted!

The following content of this documentation page has been machine-translated. But unlike other websites, it is not done on the fly. This translated text lives on GitHub repository alongside main ClickHouse codebase and waits for fellow native speakers to make it more human-readable. You can also use the original English version as a reference.

Help ClickHouse documentation by editing this page

系统。metric_log

包含表中度量值的历史记录 system.metricssystem.events,定期刷新到磁盘。
打开指标历史记录收集 system.metric_log,创建 /etc/clickhouse-server/config.d/metric_log.xml 具有以下内容:

  1. <yandex>
  2. <metric_log>
  3. <database>system</database>
  4. <table>metric_log</table>
  5. <flush_interval_milliseconds>7500</flush_interval_milliseconds>
  6. <collect_interval_milliseconds>1000</collect_interval_milliseconds>
  7. </metric_log>
  8. </yandex>

示例

  1. SELECT * FROM system.metric_log LIMIT 1 FORMAT Vertical;
  1. Row 1:
  2. ──────
  3. event_date: 2020-02-18
  4. event_time: 2020-02-18 07:15:33
  5. milliseconds: 554
  6. ProfileEvent_Query: 0
  7. ProfileEvent_SelectQuery: 0
  8. ProfileEvent_InsertQuery: 0
  9. ProfileEvent_FileOpen: 0
  10. ProfileEvent_Seek: 0
  11. ProfileEvent_ReadBufferFromFileDescriptorRead: 1
  12. ProfileEvent_ReadBufferFromFileDescriptorReadFailed: 0
  13. ProfileEvent_ReadBufferFromFileDescriptorReadBytes: 0
  14. ProfileEvent_WriteBufferFromFileDescriptorWrite: 1
  15. ProfileEvent_WriteBufferFromFileDescriptorWriteFailed: 0
  16. ProfileEvent_WriteBufferFromFileDescriptorWriteBytes: 56
  17. ...
  18. CurrentMetric_Query: 0
  19. CurrentMetric_Merge: 0
  20. CurrentMetric_PartMutation: 0
  21. CurrentMetric_ReplicatedFetch: 0
  22. CurrentMetric_ReplicatedSend: 0
  23. CurrentMetric_ReplicatedChecks: 0
  24. ...

另请参阅