Skip to content

Commit 80560ce

Browse files
committed
Don't build tag string unless using tag
Signed-off-by: Taiki Ono <[email protected]>
1 parent ea076af commit 80560ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/common/stats/statsd.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ std::string UdpStatsdSink::getName(const Metric& metric) {
8383
}
8484
}
8585

86-
const std::string buildTagStr(const std::vector<Tag>& tags) {
87-
if (tags.empty()) {
86+
const std::string UdpStatsdSink::buildTagStr(const std::vector<Tag>& tags) {
87+
if (!useTag_ || tags.empty()) {
8888
return {};
8989
}
9090

source/common/stats/statsd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ class UdpStatsdSink : public Sink {
5858

5959
private:
6060
std::string getName(const Metric& metric);
61+
const std::string buildTagStr(const std::vector<Tag>& tags);
6162

6263
ThreadLocal::SlotPtr tls_;
6364
Network::Address::InstanceConstSharedPtr server_address_;
6465
bool useTag_;
6566
};
6667

67-
const std::string buildTagStr(const std::vector<Tag>& tags);
6868

6969
/**
7070
* Per thread implementation of a TCP stats flusher for statsd.

0 commit comments

Comments
 (0)