mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-06 14:20:56 +00:00
Add units to memory figures
This commit is contained in:
parent
9b0597ca82
commit
0229274a6c
1 changed files with 6 additions and 6 deletions
|
@ -27,10 +27,10 @@ type StatsData struct {
|
||||||
|
|
||||||
SysMemTotalKB uint64
|
SysMemTotalKB uint64
|
||||||
SysMemFreeKB uint64
|
SysMemFreeKB uint64
|
||||||
MemoryInUse uint64
|
MemoryInUseKB uint64
|
||||||
MemoryRSS uint64
|
MemoryRSSKB uint64
|
||||||
|
|
||||||
MemoryPerClient uint64
|
MemPerClientBytes uint64
|
||||||
|
|
||||||
CpuUsagePct float64
|
CpuUsagePct float64
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ func updatePeriodicStats() {
|
||||||
m := runtime.MemStats{}
|
m := runtime.MemStats{}
|
||||||
runtime.ReadMemStats(&m)
|
runtime.ReadMemStats(&m)
|
||||||
|
|
||||||
Statistics.MemoryInUse = m.Alloc
|
Statistics.MemoryInUseKB = m.Alloc / 1024
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -108,8 +108,8 @@ func updatePeriodicStats() {
|
||||||
cpuUsage.SysTime = pstat.Stime
|
cpuUsage.SysTime = pstat.Stime
|
||||||
|
|
||||||
Statistics.CpuUsagePct = 100 * float64(userTicks+sysTicks) / (timeDiff.Seconds() * float64(ticksPerSecond))
|
Statistics.CpuUsagePct = 100 * float64(userTicks+sysTicks) / (timeDiff.Seconds() * float64(ticksPerSecond))
|
||||||
Statistics.MemoryRSS = uint64(pstat.Rss * pageSize)
|
Statistics.MemoryRSSKB = uint64(pstat.Rss * pageSize / 1024)
|
||||||
Statistics.MemoryPerClient = Statistics.MemoryRSS / Statistics.CurrentClientCount
|
Statistics.MemPerClientBytes = (Statistics.MemoryRSSKB * 1024) / Statistics.CurrentClientCount
|
||||||
}
|
}
|
||||||
updateSysMem()
|
updateSysMem()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue