(size_bytes)
| 20 | |
| 21 | # Helper function to pretty-print message sizes |
| 22 | def convert_size(size_bytes): |
| 23 | if size_bytes == 0: |
| 24 | return "0B" |
| 25 | size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") |
| 26 | i = int(math.floor(math.log(size_bytes, 1024))) |
| 27 | p = math.pow(1024, i) |
| 28 | s = round(size_bytes / p, 2) |
| 29 | return "%s %s" % (s, size_name[i]) |
| 30 | |
| 31 | |
| 32 | # Helper function to calculate algbw and busbw. |
no test coverage detected
searching dependent graphs…