-
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.
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/// | ||
/// \file Noop.h | ||
/// \author Adam Wegrzynek <[email protected]> | ||
/// | ||
|
||
#ifndef ALICEO2_MONITORING_BACKENDS_NOOP_H | ||
#define ALICEO2_MONITORING_BACKENDS_NOOP_H | ||
|
||
#include "Monitoring/Backend.h" | ||
|
||
namespace o2 | ||
{ | ||
/// ALICE O2 Monitoring system | ||
namespace monitoring | ||
{ | ||
/// Monitoring backends | ||
namespace backends | ||
{ | ||
|
||
/// \brief No-op backend | ||
/// | ||
/// \author Adam Wegrzynek <[email protected]> | ||
class Noop final : public Backend | ||
{ | ||
public: | ||
/// Constructs backend | ||
Noop() = default; | ||
|
||
/// Default destructor | ||
~Noop() = default; | ||
|
||
/// \@param metrics vector of metrics | ||
void send(std::vector<Metric>&& /*metrics*/) final {} | ||
|
||
/// \param metric reference to metric object: | ||
void send(const Metric& /*metric*/) final {} | ||
|
||
/// \param measurement measurement name | ||
/// \param metrics list of metrics | ||
void sendMultiple(std::string /*measurement*/, std::vector<Metric>&& /*metrics*/) final {} | ||
|
||
/// \param name tag name | ||
/// \param value tag value that is concatenated to entity string | ||
void addGlobalTag(std::string /*name*/, std::string /*value*/) final {} | ||
}; | ||
|
||
} // namespace backends | ||
} // namespace monitoring | ||
} // namespace o2 | ||
|
||
#endif // ALICEO2_MONITORING_BACKENDS_NOOP_H |
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,20 @@ | ||
#define BOOST_TEST_MODULE Test Monitoring Flume | ||
#define BOOST_TEST_DYN_LINK | ||
#include <boost/test/unit_test.hpp> | ||
|
||
#include "../src/Backends/Noop.h" | ||
|
||
namespace o2 { | ||
namespace monitoring { | ||
namespace Test { | ||
|
||
BOOST_AUTO_TEST_CASE(noopSendMetric) | ||
{ | ||
o2::monitoring::backends::Noop noopBackend{}; | ||
o2::monitoring::Metric metric{10, "myCrazyMetric"}; | ||
noopBackend.send(metric); | ||
} | ||
|
||
} // namespace Test | ||
} // namespace monitoring | ||
} // namespace o2 |