MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / format_bytes

Function format_bytes

tests/loadtest/tools/dashboard_parser.py:512–521  ·  view source on GitHub ↗
(value: float | None)

Source from the content-addressed store, hash-verified

510
511
512def format_bytes(value: float | None) -> str:
513 if value is None:
514 return "n/a"
515 units = ["B", "KB", "MB", "GB", "TB"]
516 index = 0
517 current = value
518 while current >= 1024 and index < len(units) - 1:
519 current /= 1024
520 index += 1
521 return f"{current:.1f} {units[index]}"
522
523
524def payload_etag(payload: Any) -> str:

Callers 1

build_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected