diff --git a/mqtt2prom/run b/mqtt2prom/run index 1c6cb1b..c5bea3f 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -2,7 +2,7 @@ onMessage(function ($message) use (&$data, &$stats, &$news) { $stats["metrics"][] = time(); $payload = (array) json_decode($message->payload, true); - $payload["timestamp"] = microtime(true); + $payload["timestamp"] = time(); $data[] = $payload; $news = true; }); @@ -167,7 +167,7 @@ function output(): void { filter(); global $data, $stats; - $t = microtime(true); + $t = time(); $prom = ""; $prom .=