MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / build_walltime_table

Function build_walltime_table

src/upload/benchmark_display.rs:183–223  ·  view source on GitHub ↗
(results: &[&FetchLocalRunBenchmarkResult])

Source from the content-addressed store, hash-verified

181}
182
183fn 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
225fn build_memory_table(results: &[&FetchLocalRunBenchmarkResult]) -> String {
226 let rows: Vec<MemoryRow> = results

Callers 1

build_benchmark_tableFunction · 0.85

Calls 6

format_stdev_coloredFunction · 0.85
format_durationFunction · 0.85
build_table_with_styleFunction · 0.85
labelMethod · 0.80
iconMethod · 0.80

Tested by

no test coverage detected