| 78 | constexpr auto dimensional_metrics_prefix = "ClickHouseDimensionalMetrics_"; |
| 79 | |
| 80 | void writeEvent(DB::WriteBuffer & wb, ProfileEvents::Event event) |
| 81 | { |
| 82 | const auto counter = ProfileEvents::global_counters[event].load(std::memory_order_relaxed); |
| 83 | |
| 84 | std::string metric_name{ProfileEvents::getName(static_cast<ProfileEvents::Event>(event))}; |
| 85 | std::string metric_doc{ProfileEvents::getDocumentation(static_cast<ProfileEvents::Event>(event))}; |
| 86 | |
| 87 | convertHelpToSingleLine(metric_doc); |
| 88 | |
| 89 | if (!replaceInvalidChars(metric_name)) |
| 90 | return; |
| 91 | |
| 92 | std::string key{profile_events_prefix + metric_name}; |
| 93 | |
| 94 | writeOutLine(wb, "# HELP", key, metric_doc); |
| 95 | writeOutLine(wb, "# TYPE", key, "counter"); |
| 96 | writeOutLine(wb, key, counter); |
| 97 | } |
| 98 | |
| 99 | void writeMetric(DB::WriteBuffer & wb, size_t metric) |
| 100 | { |
no test coverage detected