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>
158 ::google::protobuf::Message
const& message,
166 assert(cat <= category::unknown);
175 counts_[cat].bytesOut += bytes;
195 {
"overhead_cluster"},
196 {
"overhead_overlay"},
197 {
"overhead_manifest"},
205 {
"ledger_data_Transaction_Set_candidate_get"},
206 {
"ledger_data_Transaction_Set_candidate_share"},
207 {
"ledger_data_Transaction_Node_get"},
208 {
"ledger_data_Transaction_Node_share"},
209 {
"ledger_data_Account_State_Node_get"},
210 {
"ledger_data_Account_State_Node_share"},
212 {
"ledger_data_share"},
213 {
"ledger_Transaction_Set_candidate_share"},
214 {
"ledger_Transaction_Set_candidate_get"},
215 {
"ledger_Transaction_node_share"},
216 {
"ledger_Transaction_node_get"},
217 {
"ledger_Account_State_node_share"},
218 {
"ledger_Account_State_node_get"},
221 {
"getobject_Ledger_share"},
222 {
"getobject_Ledger_get"},
223 {
"getobject_Transaction_share"},
224 {
"getobject_Transaction_get"},
225 {
"getobject_Transaction_node_share"},
226 {
"getobject_Transaction_node_get"},
227 {
"getobject_Account_State_node_share"},
228 {
"getobject_Account_State_node_get"},
229 {
"getobject_CAS_share"},
230 {
"getobject_CAS_get"},
231 {
"getobject_Fetch_Pack_share"},
232 {
"getobject_Fetch Pack_get"},
235 {
"proof_path_request"},
236 {
"proof_path_response"},
237 {
"replay_delta_request"},
238 {
"replay_delta_response"},
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.