From: Otto Date: Tue, 24 Aug 2021 08:13:30 +0000 (+0200) Subject: Fix natural sorting of bucket names X-Git-Tag: dnsdist-1.7.0-alpha1~22^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c69a7bd43d247272c46aa70a03c413b91b9ae192;p=thirdparty%2Fpdns.git Fix natural sorting of bucket names --- 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);