1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-24 23:10:54 +00:00

format the uptime >.>

This commit is contained in:
Kane York 2015-11-16 23:15:38 -08:00
parent 976a2593eb
commit 3ad59fb47e
2 changed files with 9 additions and 9 deletions

View file

@ -14,7 +14,7 @@ type StatsData struct {
StatsDataVersion int StatsDataVersion int
StartTime time.Time StartTime time.Time
Uptime time.Duration Uptime string
BuildTime string BuildTime string
BuildHash string BuildHash string
@ -103,7 +103,7 @@ func updatePeriodicStats() {
cpuUsage.UserTime = pstat.Utime cpuUsage.UserTime = pstat.Utime
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.MemoryRSS = uint64(pstat.Rss * pageSize)
Statistics.MemoryPerClient = Statistics.MemoryRSS / Statistics.CurrentClientCount Statistics.MemoryPerClient = Statistics.MemoryRSS / Statistics.CurrentClientCount
} }
@ -120,7 +120,7 @@ func updatePeriodicStats() {
} }
{ {
Statistics.Uptime = nowUpdate.Sub(Statistics.StartTime) Statistics.Uptime = nowUpdate.Sub(Statistics.StartTime).String()
} }
} }