Add uptime to /systeminfo REST endpoint (#3796)

Signed-off-by: Jan N. Klug <github@klug.nrw>
pull/3798/head
J-N-K 2023-09-09 10:57:07 +02:00 committed by GitHub
parent 2b8475253f
commit daeb367155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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) {