(&mut self)
| 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 | |
| 119 | pub fn activity_flush_interval_secs_from_env(value: Option<&str>) -> u64 { |
nothing calls this directly
no outgoing calls
no test coverage detected