aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/traffic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/traffic.rs')
-rw-r--r--src/transport/traffic.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/transport/traffic.rs b/src/transport/traffic.rs
index 501c77b..291a76b 100644
--- a/src/transport/traffic.rs
+++ b/src/transport/traffic.rs
@@ -57,6 +57,8 @@ pub(crate) struct ByKind {
pub(crate) probe: Counter,
/// PRUNE and GRAFT (`swarm::plumtree`).
pub(crate) plumtree: Counter,
+ /// NEIGHBOUR, NEIGHBOUR_REPLY and DISCONNECT (`swarm::hyparview`).
+ pub(crate) hyparview: Counter,
}
impl ByKind {
@@ -73,6 +75,7 @@ impl ByKind {
MessageKind::Links,
MessageKind::Probe,
MessageKind::Prune,
+ MessageKind::Neighbour,
] {
let theirs = *other.get(kind);
self.get_mut(kind).absorb(theirs);
@@ -92,6 +95,9 @@ impl ByKind {
MessageKind::Links | MessageKind::LinksReply => &self.links,
MessageKind::Probe | MessageKind::ProbeReply => &self.probe,
MessageKind::Prune | MessageKind::Graft => &self.plumtree,
+ MessageKind::Neighbour | MessageKind::NeighbourReply | MessageKind::Disconnect => {
+ &self.hyparview
+ }
}
}
@@ -108,6 +114,9 @@ impl ByKind {
MessageKind::Links | MessageKind::LinksReply => &mut self.links,
MessageKind::Probe | MessageKind::ProbeReply => &mut self.probe,
MessageKind::Prune | MessageKind::Graft => &mut self.plumtree,
+ MessageKind::Neighbour | MessageKind::NeighbourReply | MessageKind::Disconnect => {
+ &mut self.hyparview
+ }
}
}
}
@@ -302,6 +311,9 @@ fn names(kind: MessageKind) -> (&'static str, &'static str) {
MessageKind::ProbeReply => ("PROBE_REPLY", "probe"),
MessageKind::Prune => ("PRUNE", "plumtree"),
MessageKind::Graft => ("GRAFT", "plumtree"),
+ MessageKind::Neighbour => ("NEIGHBOUR", "hyparview"),
+ MessageKind::NeighbourReply => ("NEIGHBOUR_REPLY", "hyparview"),
+ MessageKind::Disconnect => ("DISCONNECT", "hyparview"),
}
}