Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
cluster::Metrics Class Reference

Manages Prometheus metrics for cluster communication and node tracking. More...

#include <Metrics.hpp>

Public Member Functions

 Metrics ()
 Constructs a Metrics instance and initializes metrics.
void onNewState (ClioNode::CUuid uuid, std::shared_ptr< Backend::ClusterData const > clusterData)
 Updates metrics based on new cluster state.

Detailed Description

Manages Prometheus metrics for cluster communication and node tracking.

This class tracks cluster-related metrics including:

  • Total number of nodes detected in the cluster
  • Health status of cluster communication

Constructor & Destructor Documentation

◆ Metrics()

cluster::Metrics::Metrics ( )

Constructs a Metrics instance and initializes metrics.

Sets the initial node count to 1 (self) and marks communication as healthy.

Member Function Documentation

◆ onNewState()

void cluster::Metrics::onNewState ( ClioNode::CUuid uuid,
std::shared_ptr< Backend::ClusterData const > clusterData )

Updates metrics based on new cluster state.

This callback is invoked when cluster state changes. It updates:

  • Health status based on whether cluster data is available
  • Node count to reflect the current cluster size
Parameters
uuidThe UUID of the node (unused in current implementation)
clusterDataShared pointer to the current cluster data; may be empty if communication failed

The documentation for this class was generated from the following files:
  • /__w/clio/clio/src/cluster/Metrics.hpp
  • /__w/clio/clio/src/cluster/Metrics.cpp