Skip to content

Commit

Permalink
[OMON-376] Use separate streams in StdOut backend (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored Oct 13, 2020
1 parent 9a7a258 commit 7c6c3fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.0.6
VERSION 3.3.4
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
3 changes: 2 additions & 1 deletion src/Backends/StdOut.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inline unsigned long StdOut::convertTimestamp(const std::chrono::time_point<std:
.count();
}

StdOut::StdOut(const std::string& prefix) : mStream(), mPrefix(prefix)
StdOut::StdOut(const std::string& prefix) : mPrefix(prefix)
{
setVerbosisty(Verbosity::Debug);
MonLogger::Get() << "StdOut backend initialized" << MonLogger::End();
Expand All @@ -65,6 +65,7 @@ void StdOut::send(std::vector<Metric>&& metrics)

void StdOut::send(const Metric& metric)
{
std::ostringstream mStream;
mStream << "[" << mPrefix << "] " << metric.getName();
for (auto& value : metric.getValues()) {
auto stringValue = std::visit(overloaded{
Expand Down
3 changes: 0 additions & 3 deletions src/Backends/StdOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class StdOut final : public Backend
void addGlobalTag(std::string_view name, std::string_view value) override;

private:
/// Metric stream
std::ostringstream mStream;

/// Converts timestamp to unsigned long (miliseconds from epoch)
/// \param timestamp timestamp in std::chrono::time_point format
/// \return timestamp as unsigned long (miliseconds from epoch)
Expand Down

0 comments on commit 7c6c3fd

Please sign in to comment.