20#ifndef RIPPLE_OVERLAY_TRAFFIC_H_INCLUDED
21#define RIPPLE_OVERLAY_TRAFFIC_H_INCLUDED
23#include <xrpl/basics/safe_cast.h>
24#include <xrpl/beast/utility/instrumentation.h>
25#include <xrpl/protocol/messages.h>
167 ::google::protobuf::Message
const& message,
177 "ripple::TrafficCount::addCount : valid category input");
186 counts_[cat].bytesOut += bytes;
206 {
"overhead_cluster"},
207 {
"overhead_overlay"},
208 {
"overhead_manifest"},
215 {
"ledger_data_Transaction_Set_candidate_get"},
216 {
"ledger_data_Transaction_Set_candidate_share"},
217 {
"ledger_data_Transaction_Node_get"},
218 {
"ledger_data_Transaction_Node_share"},
219 {
"ledger_data_Account_State_Node_get"},
220 {
"ledger_data_Account_State_Node_share"},
222 {
"ledger_data_share"},
223 {
"ledger_Transaction_Set_candidate_share"},
224 {
"ledger_Transaction_Set_candidate_get"},
225 {
"ledger_Transaction_node_share"},
226 {
"ledger_Transaction_node_get"},
227 {
"ledger_Account_State_node_share"},
228 {
"ledger_Account_State_node_get"},
231 {
"getobject_Ledger_share"},
232 {
"getobject_Ledger_get"},
233 {
"getobject_Transaction_share"},
234 {
"getobject_Transaction_get"},
235 {
"getobject_Transaction_node_share"},
236 {
"getobject_Transaction_node_get"},
237 {
"getobject_Account_State_node_share"},
238 {
"getobject_Account_State_node_get"},
239 {
"getobject_CAS_share"},
240 {
"getobject_CAS_get"},
241 {
"getobject_Fetch_Pack_share"},
242 {
"getobject_Fetch Pack_get"},
243 {
"getobject_Transactions_get"},
246 {
"proof_path_request"},
247 {
"proof_path_response"},
248 {
"replay_delta_request"},
249 {
"replay_delta_response"},
250 {
"have_transactions"},
251 {
"requested_transactions"},
TrafficStats(TrafficStats const &ts)
std::atomic< std::uint64_t > bytesOut
std::atomic< std::uint64_t > messagesOut
TrafficStats(char const *n)
std::atomic< std::uint64_t > messagesIn
std::atomic< std::uint64_t > bytesIn
auto const & getCounts() const
An up-to-date copy of all the counters.
std::array< TrafficStats, category::unknown+1 > counts_
static category categorize(::google::protobuf::Message const &message, int type, bool inbound)
Given a protocol message, determine which traffic category it belongs to.
void addCount(category cat, bool inbound, int bytes)
Account for traffic associated with the given category.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.