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:
parent
976a2593eb
commit
3ad59fb47e
2 changed files with 9 additions and 9 deletions
|
@ -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
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ type StatsData struct {
|
||||||
|
|
||||||
PubSubChannelCount int
|
PubSubChannelCount int
|
||||||
|
|
||||||
MemoryInUse uint64
|
MemoryInUse uint64
|
||||||
MemoryRSS uint64
|
MemoryRSS uint64
|
||||||
|
|
||||||
MemoryPerClient uint64
|
MemoryPerClient uint64
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ const pageSize = 4096
|
||||||
|
|
||||||
var cpuUsage struct {
|
var cpuUsage struct {
|
||||||
UserTime uint64
|
UserTime uint64
|
||||||
SysTime uint64
|
SysTime uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func newStatsData() *StatsData {
|
func newStatsData() *StatsData {
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,9 +151,9 @@ func TSetup(testserver **httptest.Server, urls *TURLs) {
|
||||||
</div>
|
</div>
|
||||||
</div>`), 0600)
|
</div>`), 0600)
|
||||||
conf := &ConfigFile{
|
conf := &ConfigFile{
|
||||||
ServerID: 20,
|
ServerID: 20,
|
||||||
UseSSL: false,
|
UseSSL: false,
|
||||||
SocketOrigin: "localhost:2002",
|
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},
|
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},
|
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},
|
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},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue