MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / calculate_denial_rate_pct

Function calculate_denial_rate_pct

crates/openshell-server/src/telemetry.rs:38–43  ·  view source on GitHub ↗
(network_activity_count: u64, denied_action_count: u64)

Source from the content-addressed store, hash-verified

36
37#[allow(clippy::cast_precision_loss)]
38fn calculate_denial_rate_pct(network_activity_count: u64, denied_action_count: u64) -> f64 {
39 if network_activity_count == 0 {
40 return 0.0;
41 }
42 ((denied_action_count as f64 / network_activity_count as f64) * 100.0).clamp(0.0, 100.0)
43}
44
45fn sanitize_deny_group(raw: &str) -> DenyGroup {
46 DenyGroup::from_raw(raw)

Calls

no outgoing calls

Tested by 1