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>
150 ::google::protobuf::Message
const& message,
158 assert(cat <= category::unknown);
167 counts_[cat].bytesOut += bytes;
187 {
"overhead_cluster"},
188 {
"overhead_overlay"},
189 {
"overhead_manifest"},
197 {
"ledger_data_Transaction_Set_candidate_get"},
198 {
"ledger_data_Transaction_Set_candidate_share"},
199 {
"ledger_data_Transaction_Node_get"},
200 {
"ledger_data_Transaction_Node_share"},
201 {
"ledger_data_Account_State_Node_get"},
202 {
"ledger_data_Account_State_Node_share"},
204 {
"ledger_data_share"},
205 {
"ledger_Transaction_Set_candidate_share"},
206 {
"ledger_Transaction_Set_candidate_get"},
207 {
"ledger_Transaction_node_share"},
208 {
"ledger_Transaction_node_get"},
209 {
"ledger_Account_State_node_share"},
210 {
"ledger_Account_State_node_get"},
213 {
"getobject_Ledger_share"},
214 {
"getobject_Ledger_get"},
215 {
"getobject_Transaction_share"},
216 {
"getobject_Transaction_get"},
217 {
"getobject_Transaction_node_share"},
218 {
"getobject_Transaction_node_get"},
219 {
"getobject_Account_State_node_share"},
220 {
"getobject_Account_State_node_get"},
221 {
"getobject_CAS_share"},
222 {
"getobject_CAS_get"},
223 {
"getobject_Fetch_Pack_share"},
224 {
"getobject_Fetch Pack_get"},
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.