|
xrpld
|
TrafficCount is used to count ingress and egress wire bytes and number of messages. More...
#include <TrafficCount.h>

Classes | |
| class | TrafficStats |
Public Types | |
| enum class | Category : std::size_t { Base , Cluster , Overlay , Manifests , Transaction , TransactionDuplicate , Proposal , ProposalUntrusted , ProposalDuplicate , Validation , ValidationUntrusted , ValidationDuplicate , Validatorlist , Squelch , SquelchSuppressed , SquelchIgnored , GetSet , ShareSet , LdTscGet , LdTscShare , LdTxnGet , LdTxnShare , LdAsnGet , LdAsnShare , LdGet , LdShare , GlTscShare , GlTscGet , GlTxnShare , GlTxnGet , GlAsnShare , GlAsnGet , GlShare , GlGet , ShareHashLedger , GetHashLedger , ShareHashTx , GetHashTx , ShareHashTxnode , GetHashTxnode , ShareHashAsnode , GetHashAsnode , ShareCasObject , GetCasObject , ShareFetchPack , GetFetchPack , GetTransactions , ShareHash , GetHash , ProofPathRequest , ProofPathResponse , ReplayDeltaRequest , ReplayDeltaResponse , HaveTransactions , RequestedTransactions , Total , Unknown } |
| enum class | IsFromCluster : bool { No = false , Yes } |
| Whether a message's sender is a configured cluster member. More... | |
Public Member Functions | |
| TrafficCount ()=default | |
| void | addCount (Category cat, bool inbound, int bytes) |
| Account for traffic associated with the given category. | |
| auto const & | getCounts () const |
| An up-to-date copy of all the counters. | |
Static Public Member Functions | |
| static Category | categorize (::google::protobuf::Message const &message, protocol::MessageType type, bool inbound) |
| Given a protocol message, determine which traffic category it belongs to. | |
| static Category | attribute (Category cat, IsFromCluster isFromCluster) |
| Limits a category to what the sender can report. | |
| static std::string | toString (Category cat) |
Protected Attributes | |
| std::unordered_map< Category, TrafficStats > | counts_ |
TrafficCount is used to count ingress and egress wire bytes and number of messages.
The general intended usage is as follows:
There are two special categories:
Definition at line 35 of file TrafficCount.h.
|
strong |
Definition at line 72 of file TrafficCount.h.
|
strong |
Whether a message's sender is a configured cluster member.
| Enumerator | |
|---|---|
| No | |
| Yes | |
Definition at line 201 of file TrafficCount.h.
|
default |
|
static |
Given a protocol message, determine which traffic category it belongs to.
Definition at line 31 of file TrafficCount.cpp.
|
staticnodiscard |
Limits a category to what the sender can report.
categorize reads the message and its type, which is all an outbound message can be judged by. Inbound, the sender is also known, and one category means more than the type it was derived from: Cluster is read as traffic between configured cluster members. Any peer can send that type, so a peer outside the cluster is held to Unknown instead, leaving the category to mean what an operator reads it to mean.
| cat | The category the message's type belongs to. |
| isFromCluster | Whether the sender is a configured cluster member. |
Definition at line 139 of file TrafficCount.cpp.
| void xrpl::TrafficCount::addCount | ( | Category | cat, |
| bool | inbound, | ||
| int | bytes ) |
Account for traffic associated with the given category.
Definition at line 224 of file TrafficCount.h.
|
nodiscard |
An up-to-date copy of all the counters.
Definition at line 253 of file TrafficCount.h.
|
static |
Definition at line 259 of file TrafficCount.h.
|
protected |
Definition at line 326 of file TrafficCount.h.