From 71edd6291c19532824d3e699c3a04c1edea26355 Mon Sep 17 00:00:00 2001 From: Adam Wegrzynek Date: Thu, 17 May 2018 13:53:57 +0200 Subject: [PATCH] Adapt metric print out format --- src/Backends/InfoLoggerBackend.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Backends/InfoLoggerBackend.cxx b/src/Backends/InfoLoggerBackend.cxx index 91cfcbf4c..daddfd6f4 100644 --- a/src/Backends/InfoLoggerBackend.cxx +++ b/src/Backends/InfoLoggerBackend.cxx @@ -32,7 +32,7 @@ InfoLoggerBackend::InfoLoggerBackend() void InfoLoggerBackend::addGlobalTag(std::string name, std::string value) { if (!tagString.empty()) { - tagString += " "; + tagString += ","; } tagString += name + "=" + value; } @@ -58,13 +58,15 @@ void InfoLoggerBackend::send(const Metric& metric) std::string metricTags{}; for (const auto& tag : metric.getTags()) { if (!metricTags.empty()) { - metricTags += " "; + metricTags += ","; } metricTags += tag.name + "=" + tag.value; } - MonLogger::Get() << "InfoLoggerMonitoring : " << metric.getName() << ", " - << metric.getValue() << " Type: " << metric.getType() << ", " - << convertTimestamp(metric.getTimestamp()) << ", " << tagString << " " << metricTags + if (!metricTags.empty()) { + metricTags = "," + metricTags; + } + MonLogger::Get() << "[METRIC] " << metric.getName() << "," << metric.getType() << " " << metric.getValue() + << " " << convertTimestamp(metric.getTimestamp()) << " " << tagString << metricTags << MonLogger::End(); }