Repo-Init
 
Loading...
Searching...
No Matches
Status.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <prometheus/registry.h>
4
10 private:
11 prometheus::Gauge *_activeCtr;
12 prometheus::Counter *_totalCtr;
13 prometheus::Counter *_successCtr;
14 prometheus::Counter *_failedCtr;
15
16 public:
23 StatusTracker(const std::shared_ptr<prometheus::Registry> &reg, const std::string &name, uint64_t metricID = 0);
24
28 void incrementActive();
29
33 void decrementActive();
34
38 void incrementSuccess();
39
43 void incrementFail();
44};
45
50 private:
52
53 public:
54 explicit TrackStatus(StatusTracker &tracker) : _tracker(tracker) { _tracker.incrementActive(); }
56
58 TrackStatus(const TrackStatus & /*unused*/) = delete;
59
61 TrackStatus(TrackStatus && /*unused*/) = delete;
62
64 TrackStatus &operator=(TrackStatus /*unused*/) = delete;
65
67 TrackStatus &operator=(TrackStatus && /*unused*/) = delete;
68};
void incrementActive()
Definition Status.cpp:32
prometheus::Gauge * _activeCtr
Active number of events.
Definition Status.hpp:11
void incrementSuccess()
Definition Status.cpp:36
void incrementFail()
Definition Status.cpp:46
StatusTracker(const std::shared_ptr< prometheus::Registry > &reg, const std::string &name, uint64_t metricID=0)
Definition Status.cpp:6
prometheus::Counter * _failedCtr
Number of fail.
Definition Status.hpp:14
void decrementActive()
Definition Status.cpp:34
prometheus::Counter * _successCtr
Number of success.
Definition Status.hpp:13
prometheus::Counter * _totalCtr
Total number of counters.
Definition Status.hpp:12
TrackStatus(TrackStatus &&)=delete
Move constructor.
StatusTracker & _tracker
Definition Status.hpp:51
TrackStatus & operator=(TrackStatus &&)=delete
Move assignment operator.
TrackStatus(StatusTracker &tracker)
Definition Status.hpp:54
TrackStatus & operator=(TrackStatus)=delete
Copy assignment operator.
TrackStatus(const TrackStatus &)=delete
Copy constructor.