Skip to content

Commit

Permalink
Update summary stats
Browse files Browse the repository at this point in the history
  • Loading branch information
helius-kurt committed May 15, 2024
1 parent 5edada1 commit 5126f22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion validator-firewall/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use log::{debug, info, warn};
use serde::Deserialize;
use solana_rpc_client::nonblocking::rpc_client::RpcClient;
use std::collections::HashSet;
use std::net::{Ipv4Addr};
use std::net::Ipv4Addr;
use std::path::PathBuf;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
Expand Down
14 changes: 12 additions & 2 deletions validator-firewall/src/stats_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ impl StatsService {
all_sum += total;
info!("total_packets: {:?} = {:?}", native_addr, total);
}
info!("All traffic summary: {} pkts {} pkts/s", all_sum, (all_sum - all_last_sum) / all_las_eval_time.elapsed().as_secs());
info!(
"All traffic summary: {} pkts last_interval {} pkts {} pkts/s",
all_sum,
all_sum - all_last_sum,
(all_sum - all_last_sum) / all_las_eval_time.elapsed().as_secs().max(1)
);
all_last_sum = all_sum;
all_las_eval_time = std::time::Instant::now();

Expand All @@ -56,7 +61,12 @@ impl StatsService {
blocked_sum += total;
info!("dropped_packets: {:?} = {:?}", native_addr, total);
}
info!("Blocked traffic summary: {} pkts {} pkts/s", blocked_sum, (blocked_sum - blocked_last_sum) / blocked_las_eval_time.elapsed().as_secs());
info!(
"Blocked traffic summary: {} pkts last_interval {} pkts {} pkts/s",
blocked_sum,
blocked_sum - blocked_last_sum,
(blocked_sum - blocked_last_sum) / blocked_las_eval_time.elapsed().as_secs().max(1)
);
blocked_last_sum = blocked_sum;
blocked_las_eval_time = std::time::Instant::now();

Expand Down

0 comments on commit 5126f22

Please sign in to comment.