Repo-Init
 
Loading...
Searching...
No Matches
PrometheusServer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <prometheus/exposer.h>
4#include <prometheus/registry.h>
5
11 private:
13 std::mutex _guardLock;
15 std::unique_ptr<prometheus::Exposer> _mainExposer;
17 std::vector<std::pair<uint64_t, std::shared_ptr<prometheus::Registry>>> _vRegister;
18
20 prometheus::Family<prometheus::Info> *_infoFamily;
21
22 public:
27 explicit PrometheusServer(const std::string &serverAddr);
28
34 std::shared_ptr<prometheus::Registry> getRegistry(uint64_t regId);
35
40 std::shared_ptr<prometheus::Registry> createNewRegistry();
41
47 std::shared_ptr<prometheus::Registry> createNewRegistry(uint64_t &regId);
48
55 bool deleteRegistry(uint64_t regId);
56};
std::shared_ptr< prometheus::Registry > createNewRegistry()
std::vector< std::pair< uint64_t, std::shared_ptr< prometheus::Registry > > > _vRegister
All tracker registries.
bool deleteRegistry(uint64_t regId)
std::shared_ptr< prometheus::Registry > getRegistry(uint64_t regId)
std::unique_ptr< prometheus::Exposer > _mainExposer
Main HTTP Server.
std::mutex _guardLock
Mutex for concurrent add tracker calls.
PrometheusServer(const std::string &serverAddr)
prometheus::Family< prometheus::Info > * _infoFamily
General application information.