MCPcopy Create free account
hub / github.com/apache/impala / WriteHelpAndType

Method WriteHelpAndType

be/src/kudu/util/metrics.cc:750–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750void MetricPrototype::WriteHelpAndType(PrometheusWriter* writer,
751 const string& prefix) const {
752 static constexpr const char* const kSummary = "summary";
753
754 // The way how HdrHistogram-backed stats are presented in Kudu metrics
755 // corresponds to a 'summary' metric in Prometheus, not a 'histogram' one [1].
756 //
757 // [1] https://prometheus.io/docs/concepts/metric_types/#summary
758 const auto m_type = type();
759 const char* const metric_type_str =
760 m_type == MetricType::kHistogram ? kSummary : MetricType::Name(m_type);
761 writer->WriteEntry(Substitute("# HELP $0$1 $2\n# TYPE $3$4 $5\n",
762 prefix, name(), description(),
763 prefix, name(), metric_type_str));
764}
765
766//
767// FunctionGaugeDetacher

Callers 1

WriteAsPrometheusMethod · 0.45

Calls 3

SubstituteFunction · 0.85
WriteEntryMethod · 0.80
typeEnum · 0.50

Tested by

no test coverage detected