saveCUrrentSystemInfo improvements
This commit is contained in:
parent
118fc1554a
commit
d13a458eb0
@ -111,12 +111,22 @@ public class DefaultSystemInfoService implements SystemInfoService {
|
|||||||
return systemInfo;
|
return systemInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveCurrentSystemInfo() {
|
protected void saveCurrentSystemInfo() {
|
||||||
long ts = System.currentTimeMillis();
|
long ts = System.currentTimeMillis();
|
||||||
List<TsKvEntry> tsList = new ArrayList<>();
|
List<TsKvEntry> tsList = new ArrayList<>();
|
||||||
tsList.add(new BasicTsKvEntry(ts, new LongDataEntry("memoryUsage", getMemoryUsage())));
|
|
||||||
tsList.add(new BasicTsKvEntry(ts, new DoubleDataEntry("cpuUsage", getCpuUsage())));
|
Long memoryUsage = getMemoryUsage();
|
||||||
tsList.add(new BasicTsKvEntry(ts, new LongDataEntry("freeDiscSpace", getFreeDiscSpace())));
|
if (memoryUsage != null) {
|
||||||
|
tsList.add(new BasicTsKvEntry(ts, new LongDataEntry("memoryUsage", memoryUsage)));
|
||||||
|
}
|
||||||
|
Double cpuUsage = getCpuUsage();
|
||||||
|
if (cpuUsage != null) {
|
||||||
|
tsList.add(new BasicTsKvEntry(ts, new DoubleDataEntry("cpuUsage", cpuUsage)));
|
||||||
|
}
|
||||||
|
Long freeDiscSpace = getFreeDiscSpace();
|
||||||
|
if (freeDiscSpace != null) {
|
||||||
|
tsList.add(new BasicTsKvEntry(ts, new LongDataEntry("freeDiscSpace", freeDiscSpace)));
|
||||||
|
}
|
||||||
|
|
||||||
telemetryService.saveAndNotifyInternal(TenantId.SYS_TENANT_ID, TenantId.SYS_TENANT_ID, tsList, CALLBACK);
|
telemetryService.saveAndNotifyInternal(TenantId.SYS_TENANT_ID, TenantId.SYS_TENANT_ID, tsList, CALLBACK);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user