Skip to content

Commit

Permalink
Adapt metric print out format
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn committed May 17, 2018
1 parent 9462fc5 commit 71edd62
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Backends/InfoLoggerBackend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ InfoLoggerBackend::InfoLoggerBackend()
void InfoLoggerBackend::addGlobalTag(std::string name, std::string value)
{
if (!tagString.empty()) {
tagString += " ";
tagString += ",";
}
tagString += name + "=" + value;
}
Expand All @@ -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();
}

Expand Down

0 comments on commit 71edd62

Please sign in to comment.