Skip to content

Commit 3d5518a

Browse files
authored
Do not use display human readable timestamp when printing metric (#87)
1 parent 7c947b0 commit 3d5518a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Backends/StdOut.cxx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ void StdOut::sendMultiple(std::string measurement, std::vector<Metric>&& metrics
5656
if (!metricTags.empty()) {
5757
metricTags = "," + metricTags;
5858
}
59-
auto tStamp = std::chrono::system_clock::to_time_t(metric.getTimestamp());
60-
mStream << std::put_time(std::localtime(&tStamp), "%Y-%m-%d %X") << "\t"
61-
<< "[METRIC] " << measurement << "/" << metric.getName() << "," << metric.getType() << " "
59+
mStream << "[METRIC] " << measurement << "/" << metric.getName() << "," << metric.getType() << " "
6260
<< metric.getValue() << " " << convertTimestamp(metric.getTimestamp()) << " " << tagString
6361
<< metricTags << "\n";
6462
}
@@ -76,9 +74,7 @@ void StdOut::send(const Metric& metric)
7674
if (!metricTags.empty()) {
7775
metricTags = "," + metricTags;
7876
}
79-
auto tStamp = std::chrono::system_clock::to_time_t(metric.getTimestamp());
80-
mStream << std::put_time(std::localtime(&tStamp), "%Y-%m-%d %X") << "\t"
81-
<< "[METRIC] " << metric.getName() << "," << metric.getType() << " " << metric.getValue()
77+
mStream << "[METRIC] " << metric.getName() << "," << metric.getType() << " " << metric.getValue()
8278
<< " " << convertTimestamp(metric.getTimestamp()) << " " << tagString << metricTags
8379
<< "\n";
8480
}

0 commit comments

Comments
 (0)