Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::Counters Class Reference

Holds information about successful, failed, forwarded, etc. RPC handler calls. More...

#include <Counters.hpp>

Public Member Functions

 Counters (WorkQueue const &wq)
 Creates a new counters instance that operates on the given WorkQueue.
 
void rpcFailed (std::string const &method)
 Increments the failed count for a particular RPC method.
 
void rpcErrored (std::string const &method)
 Increments the errored count for a particular RPC method.
 
void rpcComplete (std::string const &method, std::chrono::microseconds const &rpcDuration)
 Increments the completed count for a particular RPC method.
 
void rpcForwarded (std::string const &method)
 Increments the forwarded count for a particular RPC method.
 
void rpcFailedToForward (std::string const &method)
 Increments the failed to forward count for a particular RPC method.
 
void onTooBusy ()
 Increments the global too busy counter.
 
void onNotReady ()
 Increments the global not ready counter.
 
void onBadSyntax ()
 Increments the global bad syntax counter.
 
void onUnknownCommand ()
 Increments the global unknown command/method counter.
 
void onInternalError ()
 Increments the global internal error counter.
 
std::chrono::seconds uptime () const
 
boost::json::object report () const
 

Static Public Member Functions

static Counters makeCounters (WorkQueue const &wq)
 A factory function that creates a new counters instance.
 

Detailed Description

Holds information about successful, failed, forwarded, etc. RPC handler calls.

Constructor & Destructor Documentation

◆ Counters()

rpc::Counters::Counters ( WorkQueue const & wq)

Creates a new counters instance that operates on the given WorkQueue.

Parameters
wqThe work queue to operate on

Member Function Documentation

◆ makeCounters()

static Counters rpc::Counters::makeCounters ( WorkQueue const & wq)
inlinestatic

A factory function that creates a new counters instance.

Parameters
wqThe work queue to operate on
Returns
The new instance

◆ report()

boost::json::object rpc::Counters::report ( ) const
Returns
A JSON report with current state of all counters for every method.

◆ rpcComplete()

void rpc::Counters::rpcComplete ( std::string const & method,
std::chrono::microseconds const & rpcDuration )

Increments the completed count for a particular RPC method.

Parameters
methodThe method to increment the count for
rpcDurationThe duration of the RPC call

◆ rpcErrored()

void rpc::Counters::rpcErrored ( std::string const & method)

Increments the errored count for a particular RPC method.

Parameters
methodThe method to increment the count for

◆ rpcFailed()

void rpc::Counters::rpcFailed ( std::string const & method)

Increments the failed count for a particular RPC method.

Parameters
methodThe method to increment the count for

◆ rpcFailedToForward()

void rpc::Counters::rpcFailedToForward ( std::string const & method)

Increments the failed to forward count for a particular RPC method.

Parameters
methodThe method to increment the count for

◆ rpcForwarded()

void rpc::Counters::rpcForwarded ( std::string const & method)

Increments the forwarded count for a particular RPC method.

Parameters
methodThe method to increment the count for

◆ uptime()

std::chrono::seconds rpc::Counters::uptime ( ) const
Returns
Uptime of this instance in seconds.

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