Skip to content

Commit 7c6c3fd

Browse files
authored
[OMON-376] Use separate streams in StdOut backend (#213)
1 parent 9a7a258 commit 7c6c3fd

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717

1818
# Define project
1919
project(Monitoring
20-
VERSION 3.0.6
20+
VERSION 3.3.4
2121
DESCRIPTION "O2 Monitoring library"
2222
LANGUAGES CXX
2323
)

src/Backends/StdOut.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ inline unsigned long StdOut::convertTimestamp(const std::chrono::time_point<std:
4040
.count();
4141
}
4242

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

6666
void StdOut::send(const Metric& metric)
6767
{
68+
std::ostringstream mStream;
6869
mStream << "[" << mPrefix << "] " << metric.getName();
6970
for (auto& value : metric.getValues()) {
7071
auto stringValue = std::visit(overloaded{

src/Backends/StdOut.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class StdOut final : public Backend
5353
void addGlobalTag(std::string_view name, std::string_view value) override;
5454

5555
private:
56-
/// Metric stream
57-
std::ostringstream mStream;
58-
5956
/// Converts timestamp to unsigned long (miliseconds from epoch)
6057
/// \param timestamp timestamp in std::chrono::time_point format
6158
/// \return timestamp as unsigned long (miliseconds from epoch)

0 commit comments

Comments
 (0)