From 977a4fc47969216f2aedb1d10e2b7c972f9322a1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 27 Dec 2020 18:20:31 -0800 Subject: Remove server stats --- src/main/java/org/traccar/model/Server.java | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/model/Server.java b/src/main/java/org/traccar/model/Server.java index 80062cbb0..e84943efc 100644 --- a/src/main/java/org/traccar/model/Server.java +++ b/src/main/java/org/traccar/model/Server.java @@ -18,9 +18,6 @@ package org.traccar.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.traccar.database.QueryIgnore; -import java.io.File; -import java.lang.management.ManagementFactory; - @JsonIgnoreProperties(ignoreUnknown = true) public class Server extends ExtendedModel { @@ -179,26 +176,4 @@ public class Server extends ExtendedModel { return getClass().getPackage().getImplementationVersion(); } - @QueryIgnore - public double getCpuUsage() { - return ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage(); - } - - @QueryIgnore - public double getDiskUsage() { - double total = 0; - double free = 0; - File[] drives = File.listRoots(); - if (drives != null && drives.length > 0) { - for (File drive : drives) { - total += drive.getTotalSpace(); - free += drive.getFreeSpace(); - } - } - if (total > 0) { - return 1 - free / total; - } else { - return 0; - } - } } -- cgit v1.2.3