rippled
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ripple::TrafficCount Class Reference
Collaboration diagram for ripple::TrafficCount:
Collaboration graph
[legend]

Classes

class  TrafficStats
 

Public Types

enum  category : std::size_t {
  base, cluster, overlay, manifests,
  transaction, proposal, validation, validatorlist,
  shards, get_set, share_set, ld_tsc_get,
  ld_tsc_share, ld_txn_get, ld_txn_share, ld_asn_get,
  ld_asn_share, ld_get, ld_share, gl_tsc_share,
  gl_tsc_get, gl_txn_share, gl_txn_get, gl_asn_share,
  gl_asn_get, gl_share, gl_get, share_hash_ledger,
  get_hash_ledger, share_hash_tx, get_hash_tx, share_hash_txnode,
  get_hash_txnode, share_hash_asnode, get_hash_asnode, share_cas_object,
  get_cas_object, share_fetch_pack, get_fetch_pack, get_transactions,
  share_hash, get_hash, proof_path_request, proof_path_response,
  replay_delta_request, replay_delta_response, have_transactions, requested_transactions,
  unknown
}
 

Public Member Functions

void addCount (category cat, bool inbound, int bytes)
 Account for traffic associated with the given category. More...
 
 TrafficCount ()=default
 
auto const & getCounts () const
 An up-to-date copy of all the counters. More...
 

Static Public Member Functions

static category categorize (::google::protobuf::Message const &message, int type, bool inbound)
 Given a protocol message, determine which traffic category it belongs to. More...
 

Protected Attributes

std::array< TrafficStats, category::unknown+1 > counts_
 

Detailed Description

Definition at line 32 of file TrafficCount.h.

Member Enumeration Documentation

◆ category

Enumerator
base 
cluster 
overlay 
manifests 
transaction 
proposal 
validation 
validatorlist 
shards 
get_set 
share_set 
ld_tsc_get 
ld_tsc_share 
ld_txn_get 
ld_txn_share 
ld_asn_get 
ld_asn_share 
ld_get 
ld_share 
gl_tsc_share 
gl_tsc_get 
gl_txn_share 
gl_txn_get 
gl_asn_share 
gl_asn_get 
gl_share 
gl_get 
share_hash_ledger 
get_hash_ledger 
share_hash_tx 
get_hash_tx 
share_hash_txnode 
get_hash_txnode 
share_hash_asnode 
get_hash_asnode 
share_cas_object 
get_cas_object 
share_fetch_pack 
get_fetch_pack 
get_transactions 
share_hash 
get_hash 
proof_path_request 
proof_path_response 
replay_delta_request 
replay_delta_response 
have_transactions 
requested_transactions 
unknown 

Definition at line 67 of file TrafficCount.h.

Constructor & Destructor Documentation

◆ TrafficCount()

ripple::TrafficCount::TrafficCount ( )
default

Member Function Documentation

◆ categorize()

TrafficCount::category ripple::TrafficCount::categorize ( ::google::protobuf::Message const &  message,
int  type,
bool  inbound 
)
static

Given a protocol message, determine which traffic category it belongs to.

Definition at line 25 of file TrafficCount.cpp.

◆ addCount()

void ripple::TrafficCount::addCount ( category  cat,
bool  inbound,
int  bytes 
)

Account for traffic associated with the given category.

Definition at line 173 of file TrafficCount.h.

◆ getCounts()

auto const& ripple::TrafficCount::getCounts ( ) const

An up-to-date copy of all the counters.

Returns
an object which satisfies the requirements of Container

Definition at line 196 of file TrafficCount.h.

Member Data Documentation

◆ counts_

std::array<TrafficStats, category::unknown + 1> ripple::TrafficCount::counts_
protected

Definition at line 202 of file TrafficCount.h.