Skip to content

Commit

Permalink
Add uptime to /systeminfo REST endpoint (openhab#3796)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored Sep 9, 2023
1 parent 2b84752 commit daeb367
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -39,6 +41,7 @@ public static class SystemInfo {
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) {
Expand Down

0 comments on commit daeb367

Please sign in to comment.