Kagome
Polkadot Runtime Engine in C++17
kagome::metrics::PrometheusHandler Class Reference

#include <handler_impl.hpp>

Inheritance diagram for kagome::metrics::PrometheusHandler:
Collaboration diagram for kagome::metrics::PrometheusHandler:

Public Member Functions

 PrometheusHandler ()
 
 ~PrometheusHandler () override=default
 
void registerCollectable (Registry &registry) override
 registers general type metrics registry for metrics collection More...
 
void onSessionRequest (Session::Request request, std::shared_ptr< Session > session) override
 main interface for session request handling More...
 
- Public Member Functions inherited from kagome::metrics::Handler
virtual ~Handler ()=default
 

Private Member Functions

void registerCollectable (const std::weak_ptr< prometheus::Collectable > &collectable)
 
void removeCollectable (const std::weak_ptr< prometheus::Collectable > &collectable)
 
std::size_t writeResponse (std::shared_ptr< Session > session, Session::Request request, const std::string &body)
 

Static Private Member Functions

static void cleanupStalePointers (std::vector< std::weak_ptr< prometheus::Collectable >> &collectables)
 

Private Attributes

std::mutex collectables_mutex_
 
std::vector< std::weak_ptr< prometheus::Collectable > > collectables_
 
log::Logger logger_
 

Detailed Description

Definition at line 19 of file handler_impl.hpp.

Constructor & Destructor Documentation

kagome::metrics::PrometheusHandler::PrometheusHandler ( )
explicit

Definition at line 35 of file handler_impl.cpp.

kagome::metrics::PrometheusHandler::~PrometheusHandler ( )
overridedefault

Member Function Documentation

void kagome::metrics::PrometheusHandler::cleanupStalePointers ( std::vector< std::weak_ptr< prometheus::Collectable >> &  collectables)
staticprivate

Definition at line 96 of file handler_impl.cpp.

void kagome::metrics::PrometheusHandler::onSessionRequest ( Session::Request  request,
std::shared_ptr< Session session 
)
overridevirtual

main interface for session request handling

Implements kagome::metrics::Handler.

Definition at line 38 of file handler_impl.cpp.

void kagome::metrics::PrometheusHandler::registerCollectable ( Registry registry)
overridevirtual

registers general type metrics registry for metrics collection

Implements kagome::metrics::Handler.

Definition at line 67 of file handler_impl.cpp.

void kagome::metrics::PrometheusHandler::registerCollectable ( const std::weak_ptr< prometheus::Collectable > &  collectable)
private
void kagome::metrics::PrometheusHandler::removeCollectable ( const std::weak_ptr< prometheus::Collectable > &  collectable)
private

Definition at line 81 of file handler_impl.cpp.

std::size_t kagome::metrics::PrometheusHandler::writeResponse ( std::shared_ptr< Session session,
Session::Request  request,
const std::string &  body 
)
private

Definition at line 53 of file handler_impl.cpp.

Member Data Documentation

std::vector<std::weak_ptr<prometheus::Collectable> > kagome::metrics::PrometheusHandler::collectables_
private

Definition at line 41 of file handler_impl.hpp.

std::mutex kagome::metrics::PrometheusHandler::collectables_mutex_
private

Definition at line 40 of file handler_impl.hpp.

log::Logger kagome::metrics::PrometheusHandler::logger_
private

Definition at line 43 of file handler_impl.hpp.


The documentation for this class was generated from the following files: