Repo-Init
 
Loading...
Searching...
No Matches
BaseServerStats.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <prometheus/registry.h>
4
5#define QUANTILE_DEFAULTS \
6 prometheus::Summary::Quantiles { {0.5, 0.1}, {0.9, 0.1}, {0.99, 0.1} }
7
13 private:
14 prometheus::Summary *_processingTime{nullptr};
15 prometheus::Gauge *_maxProcessingTime{nullptr};
16 prometheus::Gauge *_minProcessingTime{nullptr};
17 prometheus::Counter *_succeededCommand{nullptr};
18 prometheus::Counter *_failedCommand{nullptr};
19 prometheus::Counter *_totalCommand{nullptr};
20
21 protected:
22 void initBaseStats(const std::shared_ptr<prometheus::Registry> &reg, const std::string &name);
23
24 void consumeBaseStats(uint64_t succeeded, uint64_t failed, double processingTime);
25};
prometheus::Counter * _succeededCommand
Number of succeeded commands.
prometheus::Gauge * _minProcessingTime
Minimum value of the command processing performance.
void consumeBaseStats(uint64_t succeeded, uint64_t failed, double processingTime)
prometheus::Counter * _failedCommand
Number of failed commands.
prometheus::Gauge * _maxProcessingTime
Maximum value of the command processing performance.
prometheus::Counter * _totalCommand
Number of total received commands.
prometheus::Summary * _processingTime
Value of the command processing performance.
void initBaseStats(const std::shared_ptr< prometheus::Registry > &reg, const std::string &name)