Better numpy.datetime64 mathematics
This commit is contained in:
parent
1f53531086
commit
613e56c92a
|
@ -114,15 +114,16 @@ class HTTPHandler(MetricsHandler):
|
||||||
alert_threshold = int(
|
alert_threshold = int(
|
||||||
data['Config']['Labels'].get('io.prometheus.alert.downtime', 3600)
|
data['Config']['Labels'].get('io.prometheus.alert.downtime', 3600)
|
||||||
)
|
)
|
||||||
starttime = numpy.datetime64(started_at)
|
starttime = numpy.datetime64(started_at, 's').astype('long')
|
||||||
|
|
||||||
status_gauge.labels(
|
status_gauge.labels(
|
||||||
container.id,
|
container.id,
|
||||||
container.name,
|
container.name,
|
||||||
).set(int(running))
|
).set(int(running))
|
||||||
started_at_gauge.labels(container.id, container.name,).set(
|
started_at_gauge.labels(
|
||||||
int(int(starttime) / 1000000000) # strip nanoseconds
|
container.id,
|
||||||
)
|
container.name,
|
||||||
|
).set(starttime)
|
||||||
exit_code_gauge.labels(
|
exit_code_gauge.labels(
|
||||||
container.id,
|
container.id,
|
||||||
container.name,
|
container.name,
|
||||||
|
|
Loading…
Reference in a new issue