Refactor:2 #21
@@ -66,15 +66,17 @@ class StatisticsServiceImpl(
|
||||
cpuLogicalProcessorCount = systemInfo.hardware.processor.logicalProcessorCount,
|
||||
microarchitecture = systemInfo.hardware.processor.processorIdentifier.microarchitecture,
|
||||
memories = "${ByteUtil.formatByteSize(systemInfo.hardware.memory.total)} (${
|
||||
systemInfo.hardware.memory.physicalMemory.joinToString(
|
||||
if (systemInfo.hardware.memory.physicalMemory.size > 0) systemInfo.hardware.memory.physicalMemory.joinToString(
|
||||
" + "
|
||||
) { ByteUtil.formatByteSize(it.capacity) }
|
||||
else "Unknown"
|
||||
})",
|
||||
disks = "${ByteUtil.formatByteSize(systemInfo.hardware.diskStores.sumOf { it.size })} (${
|
||||
disks = if (systemInfo.hardware.diskStores.size > 0) "${ByteUtil.formatByteSize(systemInfo.hardware.diskStores.sumOf { it.size })} (${
|
||||
systemInfo.hardware.diskStores.joinToString(
|
||||
" + "
|
||||
) { ByteUtil.formatByteSize(it.size) }
|
||||
})"
|
||||
else "Unknown"
|
||||
)
|
||||
|
||||
override fun cpu(): CpuInfoVo {
|
||||
@@ -190,7 +192,11 @@ class StatisticsServiceImpl(
|
||||
|
||||
return OnlineInfoVo(
|
||||
current = redisUtil.keys("${SecurityProperties.jwtIssuer}_login_*")
|
||||
.distinctBy { Regex("${SecurityProperties.jwtIssuer}_login_(.*):.*").matchEntire(it)?.groupValues?.getOrNull(1) }.size.toLong(),
|
||||
.distinctBy {
|
||||
Regex("${SecurityProperties.jwtIssuer}_login_(.*):.*").matchEntire(it)?.groupValues?.getOrNull(
|
||||
1
|
||||
)
|
||||
}.size.toLong(),
|
||||
history = history
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user