From c69a7bd43d247272c46aa70a03c413b91b9ae192 Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 24 Aug 2021 10:13:30 +0200 Subject: [PATCH] Fix natural sorting of bucket names --- pdns/rec_channel_rec.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index b47807a006..7213d97f2e 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1153,7 +1153,7 @@ static StatsMap toStatsMap(const string& name, const pdns::AtomicHistogram& hist snprintf(buf, sizeof(buf), "%g", bucket.d_boundary / 1e6); pname = pbasename + "seconds_bucket{ipversion=\"v4\",le=\"" + (bucket.d_boundary == std::numeric_limits::max() ? "+Inf" : buf) + "\"}"; - entries.emplace(bucket.d_name + "-4", StatsMapEntry{pname, std::to_string(bucket.d_count)}); + entries.emplace(bucket.d_name + "4", StatsMapEntry{pname, std::to_string(bucket.d_count)}); } const auto& data6 = histogram6.getCumulativeBuckets(); @@ -1161,7 +1161,7 @@ static StatsMap toStatsMap(const string& name, const pdns::AtomicHistogram& hist snprintf(buf, sizeof(buf), "%g", bucket.d_boundary / 1e6); pname = pbasename + "seconds_bucket{ipversion=\"v6\",le=\"" + (bucket.d_boundary == std::numeric_limits::max() ? "+Inf" : buf) + "\"}"; - entries.emplace(bucket.d_name + "-6", StatsMapEntry{pname, std::to_string(bucket.d_count)}); + entries.emplace(bucket.d_name + "6", StatsMapEntry{pname, std::to_string(bucket.d_count)}); } snprintf(buf, sizeof(buf), "%g", (histogram4.getSum() + histogram6.getSum()) / 1e6); -- 2.47.2