| 748 | } |
| 749 | |
| 750 | void 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 |
no test coverage detected