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

Function build_simulation_table

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

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected