Monitoring  3.3.4
O2 Monitoring library
Backend.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
15 
16 #ifndef ALICEO2_MONITORING_CORE_BACKEND_H
17 #define ALICEO2_MONITORING_CORE_BACKEND_H
18 
19 #include <chrono>
20 #include <string>
21 #include "Monitoring/Metric.h"
22 
23 namespace o2
24 {
26 namespace monitoring
27 {
28 
33 class Backend
34 {
35  private:
37  Verbosity verbosityLevel;
38 
39  public:
41  Backend() { verbosityLevel = Verbosity::Info; }
42 
44  virtual ~Backend() = default;
45 
47  void setVerbosisty(Verbosity level) { verbosityLevel = level; }
48 
50  Verbosity getVerbosity() { return verbosityLevel; }
51 
53  virtual void send(const Metric& metric) = 0;
54 
56  virtual void send(std::vector<Metric>&& metrics) = 0;
57 
59  virtual void addGlobalTag(std::string_view name, std::string_view value) = 0;
60 };
61 
62 } // namespace monitoring
63 } // namespace o2
64 
65 #endif // ALICEO2_MONITORING_CORE_BACKEND_H
Definition: Backend.h:23
virtual ~Backend()=default
Default destructor.
virtual void send(const Metric &metric)=0
Sends metric via backend.
virtual void addGlobalTag(std::string_view name, std::string_view value)=0
Sets a tag.
Verbosity
Metric and Backedn verbosity.
Definition: Metric.h:24
Backend pure virtual interface.
Definition: Backend.h:33
void setVerbosisty(Verbosity level)
Set verbosity level.
Definition: Backend.h:47
Represents a metric including value, type of the value, name, timestamp and tags. ...
Definition: Metric.h:37
Verbosity getVerbosity()
Get verbosity level.
Definition: Backend.h:50
Backend()
Default constructor.
Definition: Backend.h:41