Monitoring  3.3.4
O2 Monitoring library
ApMonBackend.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_BACKENDS_APMONBACKEND_H
17 #define ALICEO2_MONITORING_BACKENDS_APMONBACKEND_H
18 
19 #include "Monitoring/Backend.h"
20 #include <ApMon.h>
21 #include <string>
22 #include <chrono>
23 #include <memory>
24 
25 namespace o2
26 {
28 namespace monitoring
29 {
31 namespace backends
32 {
33 
40 class ApMonBackend final : public Backend
41 {
42  public:
45  ApMonBackend(const std::string& path);
46 
48  ~ApMonBackend() = default;
49 
52  void send(std::vector<Metric>&& metrics) override;
53 
57  void send(const Metric& metric) override;
58 
62  void addGlobalTag(std::string_view name, std::string_view value) override;
63 
64  private:
68  int convertTimestamp(const std::chrono::time_point<std::chrono::system_clock>& timestamp);
69 
70  std::unique_ptr<ApMon> mApMon;
71  std::string mEntity;
72 };
73 
74 } // namespace backends
75 } // namespace monitoring
76 } // namespace o2
77 
78 #endif // ALICEO2_MONITORING_BACKENDS_APMONBACKEND_H
Backend that uses AppMon (MonALISA)
Definition: ApMonBackend.h:40
~ApMonBackend()=default
Default destructor.
Definition: Backend.h:23
Backend pure virtual interface.
Definition: Backend.h:33
Represents a metric including value, type of the value, name, timestamp and tags. ...
Definition: Metric.h:37
void send(std::vector< Metric > &&metrics) override
Definition: ApMonBackend.cxx:119
ApMonBackend(const std::string &path)
Definition: ApMonBackend.cxx:38
void addGlobalTag(std::string_view name, std::string_view value) override
Definition: ApMonBackend.cxx:53