From 0229274a6c408cf443422e74495587ef707c25a2 Mon Sep 17 00:00:00 2001 From: Kane York Date: Tue, 17 Nov 2015 12:16:46 -0800 Subject: [PATCH] Add units to memory figures --- socketserver/server/stats.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/socketserver/server/stats.go b/socketserver/server/stats.go index 9fe89978..0b9a8a30 100644 --- a/socketserver/server/stats.go +++ b/socketserver/server/stats.go @@ -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() }