1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-03 00:18:31 +00:00

Add units to memory figures

This commit is contained in:
Kane York 2015-11-17 12:16:46 -08:00
parent 9b0597ca82
commit 0229274a6c

View file

@ -27,10 +27,10 @@ type StatsData struct {
SysMemTotalKB uint64
SysMemFreeKB uint64
MemoryInUse uint64
MemoryRSS uint64
MemoryInUseKB uint64
MemoryRSSKB uint64
MemoryPerClient uint64
MemPerClientBytes uint64
CpuUsagePct float64
@ -96,7 +96,7 @@ func updatePeriodicStats() {
m := runtime.MemStats{}
runtime.ReadMemStats(&m)
Statistics.MemoryInUse = m.Alloc
Statistics.MemoryInUseKB = m.Alloc / 1024
}
{
@ -108,8 +108,8 @@ func updatePeriodicStats() {
cpuUsage.SysTime = pstat.Stime
Statistics.CpuUsagePct = 100 * float64(userTicks+sysTicks) / (timeDiff.Seconds() * float64(ticksPerSecond))
Statistics.MemoryRSS = uint64(pstat.Rss * pageSize)
Statistics.MemoryPerClient = Statistics.MemoryRSS / Statistics.CurrentClientCount
Statistics.MemoryRSSKB = uint64(pstat.Rss * pageSize / 1024)
Statistics.MemPerClientBytes = (Statistics.MemoryRSSKB * 1024) / Statistics.CurrentClientCount
}
updateSysMem()
}