Skip to content

Commit

Permalink
add sent/received
Browse files Browse the repository at this point in the history
  • Loading branch information
hitchhooker committed Dec 2, 2024
1 parent cc9e3ca commit 216c80f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ struct PingResult {
struct PingData {
latency: i64,
packetloss: f64,
packets_sent: u32,
packets_received: u32,
}

#[derive(Clone)]
Expand Down Expand Up @@ -180,6 +182,8 @@ fn create_result(config: &Args, stats: &PingStats) -> PingResult {
data: Some(PingData {
latency: avg_rtt,
packetloss: packet_loss,
packets_sent: stats.sent,
packets_received: stats.received,
}),
}
}
Expand Down

0 comments on commit 216c80f

Please sign in to comment.