MCPcopy Create free account
hub / github.com/ByConity/ByConity / writeAsyncMetrics

Method writeAsyncMetrics

src/Server/ServerPrometheusMetricsWriter.cpp:314–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void ServerPrometheusMetricsWriter::writeAsyncMetrics(WriteBuffer & wb)
315{
316 auto async_metrics_values = async_metrics.getValues();
317 for (const auto & async_metric : async_metrics_list)
318 {
319 std::string key{ASYNCHRONOUS_METRICS_PREFIX + async_metric};
320
321 replaceInvalidChars(key);
322 convertCamelToSnake(key);
323 auto value = async_metrics_values[async_metric];
324
325 // TODO: add HELP section? asynchronous_metrics contains only key and value
326 writeOutLine(wb, "# TYPE", key, GAUGE_TYPE);
327 writeOutLine(wb, key, value);
328 }
329}
330
331void ServerPrometheusMetricsWriter::writeHistogramMetrics(WriteBuffer & wb)
332{

Callers

nothing calls this directly

Calls 4

replaceInvalidCharsFunction · 0.70
writeOutLineFunction · 0.70
convertCamelToSnakeFunction · 0.50
getValuesMethod · 0.45

Tested by

no test coverage detected