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