MCPcopy Create free account
hub / github.com/apache/impala / prettyprint

Function prettyprint

shell/impala_shell/exec_summary.py:105–112  ·  view source on GitHub ↗
(val, units, divisor)

Source from the content-addressed store, hash-verified

103 label_prefix += " "
104
105 def prettyprint(val, units, divisor):
106 for unit in units:
107 if val < divisor:
108 if unit == units[0]:
109 return "%d%s" % (val, unit)
110 else:
111 return "%3.2f%s" % (val, unit)
112 val /= divisor
113
114 def prettyprint_bytes(byte_val):
115 return prettyprint(byte_val, [' B', ' KB', ' MB', ' GB', ' TB'], 1024.0)

Callers 3

prettyprint_bytesFunction · 0.70
prettyprint_unitsFunction · 0.70
prettyprint_timeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected