(results: &[&FetchLocalRunBenchmarkResult])
| 181 | } |
| 182 | |
| 183 | fn build_walltime_table(results: &[&FetchLocalRunBenchmarkResult]) -> String { |
| 184 | let rows: Vec<WalltimeRow> = results |
| 185 | .iter() |
| 186 | .map(|result| { |
| 187 | let (time_best, iterations, rel_stdev, run_time) = if let Some(wt) = &result.walltime { |
| 188 | let stdev_pct = (wt.stdev / result.value) * 100.0; |
| 189 | ( |
| 190 | format!( |
| 191 | "{}", |
| 192 | style(helpers::format_duration(result.value, Some(2))).cyan() |
| 193 | ), |
| 194 | format_with_thousands_sep(wt.iterations as u64), |
| 195 | format_stdev_colored(stdev_pct), |
| 196 | helpers::format_duration(wt.total_time, Some(2)), |
| 197 | ) |
| 198 | } else { |
| 199 | ( |
| 200 | format!( |
| 201 | "{}", |
| 202 | style(helpers::format_duration(result.value, Some(2))).cyan() |
| 203 | ), |
| 204 | "-".to_string(), |
| 205 | "-".to_string(), |
| 206 | "-".to_string(), |
| 207 | ) |
| 208 | }; |
| 209 | WalltimeRow { |
| 210 | name: result.benchmark.name.clone(), |
| 211 | time_best, |
| 212 | iterations, |
| 213 | rel_stdev, |
| 214 | run_time, |
| 215 | } |
| 216 | }) |
| 217 | .collect(); |
| 218 | build_table_with_style( |
| 219 | &rows, |
| 220 | ExecutorName::WallTime.label(), |
| 221 | ExecutorName::WallTime.icon(), |
| 222 | ) |
| 223 | } |
| 224 | |
| 225 | fn build_memory_table(results: &[&FetchLocalRunBenchmarkResult]) -> String { |
| 226 | let rows: Vec<MemoryRow> = results |
no test coverage detected