MCPcopy
hub / github.com/celery/celery / humanbytes

Function humanbytes

celery/utils/debug.py:130–135  ·  view source on GitHub ↗

Convert bytes to human-readable form (e.g., KB, MB).

(s)

Source from the content-addressed store, hash-verified

128
129
130def humanbytes(s):
131 """Convert bytes to human-readable form (e.g., KB, MB)."""
132 return next(
133 f'{hfloat(s / div if div else s)}{unit}'
134 for div, unit in UNITS if s >= div
135 )
136
137
138def mem_rss():

Callers 2

test_mem_rssFunction · 0.85
mem_rssFunction · 0.85

Calls 1

hfloatFunction · 0.85

Tested by 1

test_mem_rssFunction · 0.68