]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix natural sorting of bucket names
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 24 Aug 2021 08:13:30 +0000 (10:13 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Tue, 14 Sep 2021 06:54:01 +0000 (08:54 +0200)
pdns/rec_channel_rec.cc

index b47807a0066164b1451de70a5218c616255f1d0f..7213d97f2e366148f91ccae03a0e7d68a91a7eed 100644 (file)
@@ -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<uint64_t>::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<uint64_t>::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);