-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OMON-374] Use ostringstream in Stdout backend for atomic writes (#212)
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "../include/Monitoring/MonitoringFactory.h" | ||
|
||
#define BOOST_TEST_MODULE Test Monitoring Threads | ||
#define BOOST_TEST_DYN_LINK | ||
#include <boost/test/unit_test.hpp> | ||
#include <thread> | ||
#include <array> | ||
|
||
namespace o2 | ||
{ | ||
namespace monitoring | ||
{ | ||
namespace Test | ||
{ | ||
|
||
using namespace o2::monitoring; | ||
|
||
BOOST_AUTO_TEST_CASE(retrieveOtherParams) | ||
{ | ||
std::array<std::thread, 4> threads; | ||
for (auto& thread : threads) { | ||
thread = std::thread([] { | ||
for (int i = 0; i < 20; i++) { | ||
auto monitoring = MonitoringFactory::Get("stdout://"); | ||
monitoring->addGlobalTag("name", "Readout"); | ||
monitoring->addGlobalTag(tags::Key::Name, tags::Value::Readout); | ||
monitoring->send({1, "myCrazyMetricI"}); | ||
monitoring->send({13.33, "myCrazyMetricS"}); | ||
} | ||
}); | ||
} | ||
|
||
for (auto& thread : threads) { | ||
thread.join(); | ||
} | ||
} | ||
|
||
} // namespace Test | ||
} // namespace monitoring | ||
} // namespace o2 |