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

Method drain

crates/openshell-sandbox/src/activity_aggregator.rs:102–116  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

100 }
101
102 fn drain(&mut self) -> Option<FlushableActivitySummary> {
103 if self.network_activity_count == 0 {
104 return None;
105 }
106 let mut denials_by_group: Vec<(String, u32)> = self.denials_by_group.drain().collect();
107 denials_by_group.sort_by(|left, right| left.0.cmp(&right.0));
108 let summary = FlushableActivitySummary {
109 network_activity_count: self.network_activity_count,
110 denied_action_count: self.denied_action_count,
111 denials_by_group,
112 };
113 self.network_activity_count = 0;
114 self.denied_action_count = 0;
115 Some(summary)
116 }
117}
118
119pub fn activity_flush_interval_secs_from_env(value: Option<&str>) -> u64 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected