use std::time::Duration;
use rateguard_proto::auth::GossipAuth;
#[derive(Debug, Clone, Default)]
#[non_exhaustive]
pub struct Stats {
pub admitted: u64,
pub denied: u64,
pub overflowed: u64,
pub cluster_size: usize,
pub counted_size: usize,
pub suspects: usize,
pub tracked_keys: usize,
pub hot_keys: usize,
pub joining: bool,
pub learning: bool,
pub without_quorum: bool,
pub members_full: bool,
pub since_last_round: Option<Duration>,
pub running: bool,
pub dry_run: bool,
pub most_denied: Vec<DeniedKey>,
pub most_shadow_denied: Vec<DeniedKey>,
pub unknown_class: u64,
pub shadow_denied: u64,
pub gossip_auth: GossipAuth,
pub rejected_datagrams: RejectedDatagrams,
pub identity_conflicts: u64,
pub members_refused: u64,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
#[non_exhaustive]
pub struct RejectedDatagrams {
pub unsigned: u64,
pub bad_tag: u64,
pub malformed: u64,
pub mismatched_records: u64,
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub struct DeniedKey {
pub key_hash: u64,
pub denied_per_sec: f64,
pub requests_per_sec: f64,
pub shadow_denied_per_sec: f64,
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub struct KeyStats {
pub requests_per_sec: f64,
pub denied_per_sec: f64,
pub shadow_denied_per_sec: f64,
pub share: f64,
pub limit: crate::Limit,
pub shadow: Option<crate::Limit>,
}
#[derive(Debug, Default)]
pub(crate) struct Report {
pub stats: Stats,
pub attempts: u64,
pub last_round: Option<u64>,
}