MCPcopy Index your code
hub / github.com/dbcli/pgcli / duration_to_string

Method duration_to_string

pgcli/pyev.py:159–173  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

157
158 #
159 def duration_to_string(self, value):
160 if value < 1:
161 return self.good_format("<1 ms")
162 elif value < 100:
163 return self.good_format("%.2f ms" % value)
164 elif value < 1000:
165 return self.warning_format("%.2f ms" % value)
166 elif value < 60000:
167 return self.critical_format(
168 "%.2f s" % (value / 1000.0),
169 )
170 else:
171 return self.critical_format(
172 "%.2f m" % (value / 60000.0),
173 )
174
175 # }
176 #

Callers 2

create_linesMethod · 0.95
generate_linesMethod · 0.95

Calls 3

good_formatMethod · 0.95
warning_formatMethod · 0.95
critical_formatMethod · 0.95

Tested by

no test coverage detected