@@ -46,26 +46,26 @@ UdpStatsdSink::UdpStatsdSink(ThreadLocal::SlotAllocator& tls,
4646}
4747
4848void UdpStatsdSink::flushCounter (const Counter& counter, uint64_t delta) {
49- std::string message (
49+ const std::string message (
5050 fmt::format (" envoy.{}:{}|c{}" , getName (counter), delta, buildTagStr (counter.tags ())));
5151 tls_->getTyped <Writer>().write (message);
5252}
5353
5454void UdpStatsdSink::flushGauge (const Gauge& gauge, uint64_t value) {
55- std::string message (
55+ const std::string message (
5656 fmt::format (" envoy.{}:{}|g{}" , getName (gauge), value, buildTagStr (gauge.tags ())));
5757 tls_->getTyped <Writer>().write (message);
5858}
5959
6060void UdpStatsdSink::onHistogramComplete (const Histogram& histogram, uint64_t value) {
6161 // For statsd histograms are all timers.
62- std::string message (fmt::format (" envoy.{}:{}|ms{}" , getName (histogram),
62+ const std::string message (fmt::format (" envoy.{}:{}|ms{}" , getName (histogram),
6363 std::chrono::milliseconds (value).count (),
6464 buildTagStr (histogram.tags ())));
6565 tls_->getTyped <Writer>().write (message);
6666}
6767
68- std::string UdpStatsdSink::getName (const Metric& metric) {
68+ const std::string UdpStatsdSink::getName (const Metric& metric) {
6969 if (use_tag_) {
7070 return metric.tagExtractedName ();
7171 } else {
0 commit comments