(bucket.d_boundary == std::numeric_limits<uint64_t>::max() ? "+Inf" : buf) + "\"}";
entries.emplace(bucket.d_name + "4", StatsMapEntry{pname, std::to_string(bucket.d_count)});
}
+ snprintf(buf, sizeof(buf), "%g", histogram4.getSum() / 1e6);
+ entries.emplace(name + "sum4", StatsMapEntry{pbasename + "seconds_count{ipversion=\"v4\"}", buf});
+ entries.emplace(name + "count4", StatsMapEntry{pbasename + "seconds_count{ipversion=\"v4\"}", std::to_string(data4.back().d_count)});
const auto& data6 = histogram6.getCumulativeBuckets();
for (const auto& bucket : data6) {
(bucket.d_boundary == std::numeric_limits<uint64_t>::max() ? "+Inf" : buf) + "\"}";
entries.emplace(bucket.d_name + "6", StatsMapEntry{pname, std::to_string(bucket.d_count)});
}
-
- snprintf(buf, sizeof(buf), "%g", (histogram4.getSum() + histogram6.getSum()) / 1e6);
- entries.emplace(name + "sum", StatsMapEntry{pbasename + "seconds_sum", buf});
- entries.emplace(name + "count", StatsMapEntry{pbasename + "seconds_count", std::to_string(data4.back().d_count + data6.back().d_count)});
+ snprintf(buf, sizeof(buf), "%g", histogram6.getSum() / 1e6);
+ entries.emplace(name + "sum6", StatsMapEntry{pbasename + "seconds_count{ipversion=\"v6\"}", buf});
+ entries.emplace(name + "count6", StatsMapEntry{pbasename + "seconds_count{ipversion=\"v6\"}", std::to_string(data6.back().d_count)});
return entries;
}
helpname = prometheusMetricName.substr(0, prometheusMetricName.find('{'));
}
else if (metricDetails.d_prometheusType == PrometheusMetricType::histogram) {
+ helpname = prometheusMetricName.substr(0, prometheusMetricName.find('{'));
// name is XXX_count, strip the _count part
- helpname = prometheusMetricName.substr(0, prometheusMetricName.length() - 6);
+ helpname = helpname.substr(0, helpname.length() - 6);
}
output << "# TYPE " << helpname << " " << prometheusTypeName << "\n";
output << "# HELP " << helpname << " " << metricDetails.d_description << "\n";
MetricDefinition(PrometheusMetricType::histogram,
"histogram of our answer times to clients")},
// For cumulative histogram, state the xxx_count name where xxx matches the name in rec_channel_rec
- { "cumul-authanswers-count",
+ { "cumul-authanswers-count4",
MetricDefinition(PrometheusMetricType::histogram,
"histogram of answer times of authoritative servers")},
{ "almost-expired-pushed",