Repo-Init
 
Loading...
Searching...
No Matches
TelnetStats.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <prometheus/registry.h>
6
11 std::chrono::high_resolution_clock::time_point connectTime;
12 std::chrono::high_resolution_clock::time_point disconnectTime;
13 size_t uploadBytes{};
14 size_t downloadBytes{};
15 uint64_t successCmdCtr{};
16 uint64_t failCmdCtr{};
17};
18
23 std::chrono::high_resolution_clock::time_point processingTimeStart;
24 std::chrono::high_resolution_clock::time_point processingTimeEnd;
28};
29
34 private:
35 prometheus::Family<prometheus::Info> *_infoFamily;
36 prometheus::Gauge *_activeConnection;
37 prometheus::Counter *_refusedConnection;
38 prometheus::Counter *_totalConnection;
39 prometheus::Counter *_totalUploadBytes;
40 prometheus::Counter *_totalDownloadBytes;
41 prometheus::Summary *_sessionDuration;
42 prometheus::Gauge *_maxSessionDuration;
43 prometheus::Gauge *_minSessionDuration;
44
45 public:
52 TelnetStats(const std::shared_ptr<prometheus::Registry> &reg, uint16_t portNumber,
53 const std::string &prependName = "");
54
60 void consumeStats(const TelnetSessionStats &stat, bool sessionClosed);
61
66 void consumeStats(const TelnetServerStats &stat);
67};
void consumeStats(const TelnetSessionStats &stat, bool sessionClosed)
prometheus::Counter * _totalDownloadBytes
Total downloaded bytes.
prometheus::Family< prometheus::Info > * _infoFamily
Information metric family.
prometheus::Counter * _totalConnection
Number of total received connections.
prometheus::Counter * _refusedConnection
Number of refused connections.
prometheus::Gauge * _maxSessionDuration
Maximum duration of sessions.
prometheus::Gauge * _activeConnection
Number of active connections.
prometheus::Counter * _totalUploadBytes
Total uploaded bytes.
prometheus::Gauge * _minSessionDuration
Minimum duration of sessions.
prometheus::Summary * _sessionDuration
Value of the duration of sessions.
TelnetStats(const std::shared_ptr< prometheus::Registry > &reg, uint16_t portNumber, const std::string &prependName="")
std::chrono::high_resolution_clock::time_point processingTimeStart
Processing time start.
uint64_t activeConnectionCtr
Number of active connections.
std::chrono::high_resolution_clock::time_point processingTimeEnd
Processing time end.
uint64_t refusedConnectionCtr
Number of refused connections.
uint64_t acceptedConnectionCtr
Number of accepted connections.
std::chrono::high_resolution_clock::time_point disconnectTime
Connection end time.
uint64_t failCmdCtr
Failed commands.
uint64_t successCmdCtr
Successful commands.
size_t downloadBytes
Downloaded bytes.
std::chrono::high_resolution_clock::time_point connectTime
Connection start time.
size_t uploadBytes
Uploaded bytes.