From 3ad59fb47eb107404475a79e06de2ede7d36cc1a Mon Sep 17 00:00:00 2001 From: Kane York Date: Mon, 16 Nov 2015 23:15:38 -0800 Subject: [PATCH] format the uptime >.> --- socketserver/server/stats.go | 12 ++++++------ socketserver/server/subscriptions_test.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/socketserver/server/stats.go b/socketserver/server/stats.go index 25173db7..dd4f4b55 100644 --- a/socketserver/server/stats.go +++ b/socketserver/server/stats.go @@ -14,7 +14,7 @@ type StatsData struct { StatsDataVersion int StartTime time.Time - Uptime time.Duration + Uptime string BuildTime string BuildHash string @@ -24,8 +24,8 @@ type StatsData struct { PubSubChannelCount int - MemoryInUse uint64 - MemoryRSS uint64 + MemoryInUse uint64 + MemoryRSS uint64 MemoryPerClient uint64 @@ -59,7 +59,7 @@ const pageSize = 4096 var cpuUsage struct { UserTime uint64 - SysTime uint64 + SysTime uint64 } func newStatsData() *StatsData { @@ -103,7 +103,7 @@ func updatePeriodicStats() { cpuUsage.UserTime = pstat.Utime 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.MemoryPerClient = Statistics.MemoryRSS / Statistics.CurrentClientCount } @@ -120,7 +120,7 @@ func updatePeriodicStats() { } { - Statistics.Uptime = nowUpdate.Sub(Statistics.StartTime) + Statistics.Uptime = nowUpdate.Sub(Statistics.StartTime).String() } } diff --git a/socketserver/server/subscriptions_test.go b/socketserver/server/subscriptions_test.go index f404654e..5d7adba3 100644 --- a/socketserver/server/subscriptions_test.go +++ b/socketserver/server/subscriptions_test.go @@ -151,9 +151,9 @@ func TSetup(testserver **httptest.Server, urls *TURLs) { `), 0600) conf := &ConfigFile{ - ServerID: 20, - UseSSL: false, - SocketOrigin: "localhost:2002", + ServerID: 20, + UseSSL: false, + SocketOrigin: "localhost:2002", OurPublicKey: []byte{176, 149, 72, 209, 35, 42, 110, 220, 22, 236, 212, 129, 213, 199, 1, 227, 185, 167, 150, 159, 117, 202, 164, 100, 9, 107, 45, 141, 122, 221, 155, 73}, OurPrivateKey: []byte{247, 133, 147, 194, 70, 240, 211, 216, 223, 16, 241, 253, 120, 14, 198, 74, 237, 180, 89, 33, 146, 146, 140, 58, 88, 160, 2, 246, 112, 35, 239, 87}, BackendPublicKey: []byte{19, 163, 37, 157, 50, 139, 193, 85, 229, 47, 166, 21, 153, 231, 31, 133, 41, 158, 8, 53, 73, 0, 113, 91, 13, 181, 131, 248, 176, 18, 1, 107},