Skip to content

Commit

Permalink
fix(host_metrics): use assert!() insead of assert_eq!()
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
  • Loading branch information
aryan9600 committed Jan 3, 2025
1 parent b11bf61 commit 9faccc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/sources/host_metrics/netlink_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ mod tests {
dst = true;
}
}
assert_eq!(source, true);
assert_eq!(dst, true);
assert!(source);
assert!(dst);
}
}
3 changes: 0 additions & 3 deletions src/sources/host_metrics/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,11 @@ mod tests {
// and the network_tcp_connections_total has the "state" tag.
#[cfg(target_os = "linux")]
{
let mut n_tcp_conns_total_metric = 0;
let mut n_tx_queued_bytes_metric = 0;
let mut n_rx_queued_bytes_metric = 0;

metrics.iter().for_each(|metric| {
if metric.name() == NETWORK_TCP_CONNS_TOTAL {
n_tcp_conns_total_metric += 1;
let tags = metric.tags().unwrap();
assert!(
tags.contains_key(TCP_CONN_STATE),
Expand All @@ -216,7 +214,6 @@ mod tests {
return;
}
});
assert_eq!(n_tcp_conns_total_metric, 1);
assert_eq!(n_tx_queued_bytes_metric, 1);
assert_eq!(n_rx_queued_bytes_metric, 1);
}
Expand Down

0 comments on commit 9faccc7

Please sign in to comment.