| 183 | } |
| 184 | |
| 185 | fn write_output<W: io::Write>( |
| 186 | &self, |
| 187 | writer: &mut W, |
| 188 | formatted_exec_details: &str, |
| 189 | ) -> Result<()> { |
| 190 | if !self.quiet { |
| 191 | writeln!(writer, "{formatted_exec_details}")?; |
| 192 | |
| 193 | let instrument_mode = self.instrumented_registry.instrument_mode(); |
| 194 | if instrument_mode != InstrumentedObjectStoreMode::Disabled { |
| 195 | writeln!(writer, "{OBJECT_STORE_PROFILING_HEADER}")?; |
| 196 | for store in self.instrumented_registry.stores() { |
| 197 | let requests = store.take_requests(); |
| 198 | |
| 199 | if !requests.is_empty() { |
| 200 | writeln!(writer, "{store}")?; |
| 201 | if instrument_mode == InstrumentedObjectStoreMode::Trace { |
| 202 | for req in requests.iter() { |
| 203 | writeln!(writer, "{req}")?; |
| 204 | } |
| 205 | // Add an extra blank line to help visually organize the output |
| 206 | writeln!(writer)?; |
| 207 | } |
| 208 | |
| 209 | writeln!(writer, "Summaries:")?; |
| 210 | let summaries = RequestSummaries::new(&requests); |
| 211 | writeln!(writer, "{summaries}")?; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | Ok(()) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | #[cfg(test)] |