MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / format_results

Function format_results

python/benchmarks/performance_benchmark.py:187–208  ·  view source on GitHub ↗

Format results for display.

(results: Dict[str, Any])

Source from the content-addressed store, hash-verified

185
186
187def format_results(results: Dict[str, Any]) -> str:
188 """Format results for display."""
189 output = []
190 output.append("\n" + "=" * 60)
191 output.append("B+ Tree Performance Benchmark Results")
192 output.append("=" * 60)
193
194 for test_name, data in results.items():
195 output.append(f"\n{test_name}:")
196 if "duration" in data:
197 output.append(f" Duration: {data['duration']:.4f} seconds")
198 if "ops_per_second" in data:
199 output.append(f" Operations/second: {data['ops_per_second']:,.0f}")
200 else:
201 for key, value in data.items():
202 if isinstance(value, float):
203 output.append(f" {key}: {value:.4f}")
204 else:
205 output.append(f" {key}: {value}")
206
207 output.append("\n" + "=" * 60)
208 return "\n".join(output)
209
210
211def save_results(results: Dict[str, Any], filename: str = None):

Callers 1

mainFunction · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected