From 20a3347de651df916d2cdfd2bd52c6b80c0977c8 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Thu, 29 Aug 2024 14:29:29 +0200 Subject: [PATCH] ADD SELF INFO --- mqtt2prom/run | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mqtt2prom/run b/mqtt2prom/run index 68c0475..bab63fb 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -274,6 +274,21 @@ function output(): void $prom .= $entry["name"] . $labels . " " . $entry["value"] . "\n"; } + + $prom .= + "memory_usage_current{unit=\"bytes\"} " . memory_get_usage() . "\n"; + $prom .= + "memory_usage_peak{unit=\"bytes\"} " . memory_get_peak_usage() . "\n"; + + $prom .= + "memory_usage_current_allocated{unit=\"bytes\"} " . + memory_get_usage(true) . + "\n"; + $prom .= + "memory_usage_peak_allocated{unit=\"bytes\"} " . + memory_get_peak_usage(true) . + "\n"; + file_put_contents("/www/metrics/new.prom", $prom); file_put_contents( "/www/metrics/new.json",