-
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.
Remove mutex from Metric class (#95)
- Loading branch information
Showing
11 changed files
with
122 additions
and
132 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
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
/// | ||
/// \file ComplexMetric.h | ||
/// \author Adam Wegrzynek <[email protected]> | ||
/// | ||
|
||
#ifndef ALICEO2_MONITORING_CORE_COMPLEXMETRIC_H | ||
#define ALICEO2_MONITORING_CORE_COMPLEXMETRIC_H | ||
|
||
#include "Metric.h" | ||
#include <mutex> | ||
|
||
namespace o2 | ||
{ | ||
/// ALICE O2 Monitoring system | ||
namespace monitoring | ||
{ | ||
|
||
// \brief Extends metric to value setter | ||
class ComplexMetric : public o2::monitoring::Metric | ||
{ | ||
public: | ||
/// Integer metric construtor | ||
/// \param value metric value (int) | ||
/// \param name metric name | ||
ComplexMetric(int value, const std::string& name); | ||
|
||
/// String metric construtor | ||
/// \param value metric value (string) | ||
/// \param name the metric name | ||
ComplexMetric(std::string value, const std::string& name); | ||
|
||
/// Double metric constructor | ||
/// \param value metric value (double) | ||
/// \param name metric name | ||
ComplexMetric(double value, const std::string& name); | ||
|
||
/// uint64_t metric constructor | ||
/// \param value metric value (uint64_t) | ||
/// \param name metric name | ||
ComplexMetric(uint64_t value, const std::string& name); | ||
|
||
/// boost variant metric constructor, required by derived metrics logic | ||
/// \param value metric value (boost variant) | ||
/// \param name metric name | ||
ComplexMetric(boost::variant< int, std::string, double, uint64_t >, const std::string& name); | ||
|
||
/// Default destructor | ||
~ComplexMetric() = default; | ||
|
||
// Resets metric's timestamp | ||
void resetTimestamp(); | ||
|
||
/// Assign operator overload, assignes new values to the metric object | ||
ComplexMetric& operator=(const boost::variant< int, std::string, double, uint64_t >& value); | ||
}; | ||
|
||
} // namespace monitoring | ||
} // namespace o2 | ||
|
||
#endif // ALICEO2_MONITORING_CORE_COMPLEXMETRIC_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
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,49 @@ | ||
/// | ||
/// \file ComplexMetric.cxx | ||
/// \author Adam Wegrzynek <[email protected]> | ||
/// | ||
|
||
#include "Monitoring/ComplexMetric.h" | ||
|
||
#include <iostream> | ||
#include <chrono> | ||
#include <memory> | ||
|
||
namespace o2 | ||
{ | ||
/// ALICE O2 Monitoring system | ||
namespace monitoring | ||
{ | ||
|
||
ComplexMetric::ComplexMetric(int value, const std::string& name) : | ||
Metric(value, name) | ||
{} | ||
|
||
ComplexMetric::ComplexMetric(std::string value, const std::string& name) : | ||
Metric(value, name) | ||
{} | ||
|
||
ComplexMetric::ComplexMetric(double value, const std::string& name) : | ||
Metric(value, name) | ||
{} | ||
|
||
ComplexMetric::ComplexMetric(uint64_t value, const std::string& name) : | ||
Metric(value, name) | ||
{} | ||
|
||
ComplexMetric::ComplexMetric(boost::variant< int, std::string, double, uint64_t > value, const std::string& name) : | ||
Metric(value, name) | ||
{} | ||
|
||
void ComplexMetric::resetTimestamp() | ||
{ | ||
mTimestamp = Metric::getCurrentTimestamp(); | ||
} | ||
|
||
ComplexMetric& ComplexMetric::operator=(const boost::variant< int, std::string, double, uint64_t >& value) { | ||
mValue = value; | ||
return *this; | ||
} | ||
|
||
} // namespace monitoring | ||
} // namespace o2 |
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