Finish memory statistics information api

This commit is contained in:
2023-12-08 17:15:05 +08:00
parent 971a7007c7
commit 55c64a0de2
5 changed files with 7 additions and 20 deletions

View File

@@ -10,6 +10,4 @@ interface IStatisticsService {
fun cpu(): CpuInfoVo
fun memory(): MemoryInfoVo
fun jvm(): JvmInfoVo
}

View File

@@ -118,11 +118,8 @@ class StatisticsServiceImpl : IStatisticsService {
virtualMax = systemInfo.hardware.memory.virtualMemory.virtualMax,
virtualInUse = systemInfo.hardware.memory.virtualMemory.virtualInUse,
swapTotal = systemInfo.hardware.memory.virtualMemory.swapTotal,
swapUsed = systemInfo.hardware.memory.virtualMemory.swapUsed
)
override fun jvm() = JvmInfoVo(
totalMemory = runtime.totalMemory(),
freeMemory = runtime.freeMemory()
swapUsed = systemInfo.hardware.memory.virtualMemory.swapUsed,
jvmTotal = runtime.totalMemory(),
jvmFree = runtime.freeMemory()
)
}