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

Function build_simulation_table

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

Source from the content-addressed store, hash-verified

132}
133
134fn build_simulation_table(results: &[&FetchLocalRunBenchmarkResult]) -> String {
135 let rows: Vec<SimulationRow> = results
136 .iter()
137 .map(|result| {
138 let (instructions, cache, memory, sys_time) = result
139 .valgrind
140 .as_ref()
141 .and_then(|v| v.time_distribution.as_ref())
142 .map(|td| {
143 let total = result.value;
144 let ir_pct = (td.ir / total) * 100.0;
145 let l1m_pct = (td.l1m / total) * 100.0;
146 let llm_pct = (td.llm / total) * 100.0;
147 (
148 format_distribution_pct(ir_pct),
149 format_distribution_pct(l1m_pct),
150 format_distribution_pct(llm_pct),
151 helpers::format_duration(td.sys, Some(2)),
152 )
153 })
154 .unwrap_or_else(|| {
155 (
156 "-".to_string(),
157 "-".to_string(),
158 "-".to_string(),
159 "-".to_string(),
160 )
161 });
162
163 SimulationRow {
164 name: result.benchmark.name.clone(),
165 time: format!(
166 "{}",
167 style(helpers::format_duration(result.value, Some(2))).cyan()
168 ),
169 instructions,
170 cache,
171 memory,
172 sys_time,
173 }
174 })
175 .collect();
176 build_table_with_style(
177 &rows,
178 ExecutorName::Valgrind.label(),
179 ExecutorName::Valgrind.icon(),
180 )
181}
182
183fn build_walltime_table(results: &[&FetchLocalRunBenchmarkResult]) -> String {
184 let rows: Vec<WalltimeRow> = results

Callers 1

build_benchmark_tableFunction · 0.85

Calls 5

format_distribution_pctFunction · 0.85
format_durationFunction · 0.85
build_table_with_styleFunction · 0.85
labelMethod · 0.80
iconMethod · 0.80

Tested by

no test coverage detected