MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fmt_bytes

Function fmt_bytes

benchmarks/run_benchmarks.py:391–398  ·  view source on GitHub ↗
(b: int | None)

Source from the content-addressed store, hash-verified

389
390
391def fmt_bytes(b: int | None) -> str:
392 if b is None:
393 return "N/A"
394 if b >= 1_048_576:
395 return f"{b / 1_048_576:.1f} MiB"
396 if b >= 1024:
397 return f"{b / 1024:.1f} KiB"
398 return f"{b} B"
399
400
401def fmt_ms(v: float | None) -> str:

Callers 1

generate_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected