From daeb367155bb0c327fa0cc4e98b9764209044471 Mon Sep 17 00:00:00 2001 From: J-N-K Date: Sat, 9 Sep 2023 10:57:07 +0200 Subject: [PATCH] Add uptime to /systeminfo REST endpoint (#3796) Signed-off-by: Jan N. Klug --- .../core/io/rest/internal/resources/beans/SystemInfoBean.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.openhab.core.io.rest/src/main/java/org/openhab/core/io/rest/internal/resources/beans/SystemInfoBean.java b/bundles/org.openhab.core.io.rest/src/main/java/org/openhab/core/io/rest/internal/resources/beans/SystemInfoBean.java index 47c83150d9..875551ec16 100644 --- a/bundles/org.openhab.core.io.rest/src/main/java/org/openhab/core/io/rest/internal/resources/beans/SystemInfoBean.java +++ b/bundles/org.openhab.core.io.rest/src/main/java/org/openhab/core/io/rest/internal/resources/beans/SystemInfoBean.java @@ -12,6 +12,8 @@ */ package org.openhab.core.io.rest.internal.resources.beans; +import java.lang.management.ManagementFactory; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.OpenHAB; @@ -39,6 +41,7 @@ public class SystemInfoBean { public final int availableProcessors = Runtime.getRuntime().availableProcessors(); public final long freeMemory = Runtime.getRuntime().freeMemory(); public final long totalMemory = Runtime.getRuntime().totalMemory(); + public final long uptime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000; public final int startLevel; public SystemInfo(int startLevel) {