mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-10 05:38:10 +00:00
fix: Count cluster messages as cluster traffic (#8308)
This commit is contained in:
@@ -25,6 +25,16 @@ public:
|
||||
auto const known = TrafficCount::categorize(message, protocol::mtPING, false);
|
||||
BEAST_EXPECT(known == TrafficCount::Category::Base);
|
||||
|
||||
// cluster messages have a category of their own, in both directions; the same lookup
|
||||
// serves outbound traffic, so a missing entry would hide them from a node's report
|
||||
// whichever way they traveled
|
||||
BEAST_EXPECT(
|
||||
TrafficCount::categorize(message, protocol::mtCLUSTER, true) ==
|
||||
TrafficCount::Category::Cluster);
|
||||
BEAST_EXPECT(
|
||||
TrafficCount::categorize(message, protocol::mtCLUSTER, false) ==
|
||||
TrafficCount::Category::Cluster);
|
||||
|
||||
// an unknown message type is categorized as unknown
|
||||
auto const unknown =
|
||||
TrafficCount::categorize(message, static_cast<protocol::MessageType>(99), false);
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace xrpl {
|
||||
std::unordered_map<protocol::MessageType, TrafficCount::Category> const kTypeLookup = {
|
||||
{protocol::mtPING, TrafficCount::Category::Base},
|
||||
{protocol::mtSTATUS_CHANGE, TrafficCount::Category::Base},
|
||||
{protocol::mtCLUSTER, TrafficCount::Category::Cluster},
|
||||
{protocol::mtMANIFESTS, TrafficCount::Category::Manifests},
|
||||
{protocol::mtENDPOINTS, TrafficCount::Category::Overlay},
|
||||
{protocol::mtTRANSACTION, TrafficCount::Category::Transaction},
|
||||
|
||||
Reference in New Issue
Block a user