From 7bb9e7f3e7cf5a3876235f8c0480a9a29313bd49 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Wed, 14 Aug 2024 16:28:23 +0200 Subject: [PATCH] no fraction on timestamp --- mqtt2prom/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 .=