summaryrefslogtreecommitdiffstats
path: root/src/transport/traffic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/traffic.rs')
-rw-r--r--src/transport/traffic.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/transport/traffic.rs b/src/transport/traffic.rs
index e912302..2134521 100644
--- a/src/transport/traffic.rs
+++ b/src/transport/traffic.rs
@@ -37,8 +37,8 @@ pub(crate) struct ByKind {
pub(crate) hello: Counter,
pub(crate) hello_reply: Counter,
pub(crate) sync: Counter,
- pub(crate) ping: Counter,
- pub(crate) pong: Counter,
+ pub(crate) status: Counter,
+ pub(crate) status_reply: Counter,
pub(crate) blob: Counter,
/// WHO and ME (`transport::identity`), counted by the identity layer under the
/// address they went to or came from.
@@ -51,8 +51,8 @@ impl ByKind {
MessageKind::Hello => &mut self.hello,
MessageKind::HelloReply => &mut self.hello_reply,
MessageKind::Sync => &mut self.sync,
- MessageKind::Ping => &mut self.ping,
- MessageKind::Pong => &mut self.pong,
+ MessageKind::Status => &mut self.status,
+ MessageKind::StatusReply => &mut self.status_reply,
MessageKind::Blob => &mut self.blob,
MessageKind::Who | MessageKind::Me => &mut self.identity,
}
@@ -227,20 +227,20 @@ mod tests {
#[test]
fn totals_survive_retain() {
let traffic = Traffic::default();
- traffic.sent("a", MessageKind::Ping, 100);
+ traffic.sent("a", MessageKind::Status, 100);
traffic.sent("b", MessageKind::Sync, 1000);
- traffic.received("b", MessageKind::Pong, 90);
+ traffic.received("b", MessageKind::StatusReply, 90);
traffic.refused("a", MessageKind::Sync, 500);
let b = traffic.peer("b").unwrap();
assert_eq!(b.sent.sync.messages, 1);
- assert_eq!(b.received.pong.bytes, 90);
+ assert_eq!(b.received.status_reply.bytes, 90);
traffic.retain(|peer| peer == "b");
assert!(traffic.peer("a").is_none());
let total = traffic.total();
- assert_eq!(total.sent.ping.bytes, 100);
+ assert_eq!(total.sent.status.bytes, 100);
assert_eq!(total.sent.sync.bytes, 1000);
assert_eq!(total.refused.sync.bytes, 500);
}