mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-28 08:50:55 +00:00
Add Health to /stats, add irc reconnect
This commit is contained in:
parent
88b356177a
commit
d49c88a222
4 changed files with 63 additions and 9 deletions
|
@ -21,6 +21,11 @@ type StatsData struct {
|
|||
|
||||
CachedStatsLastUpdate time.Time
|
||||
|
||||
Health struct {
|
||||
IRC bool
|
||||
Backend map[string]time.Time
|
||||
}
|
||||
|
||||
CurrentClientCount uint64
|
||||
|
||||
PubSubChannelCount int
|
||||
|
@ -76,7 +81,7 @@ func commandCounter() {
|
|||
}
|
||||
|
||||
// StatsDataVersion is the version of the StatsData struct.
|
||||
const StatsDataVersion = 5
|
||||
const StatsDataVersion = 6
|
||||
const pageSize = 4096
|
||||
|
||||
var cpuUsage struct {
|
||||
|
@ -154,6 +159,10 @@ func updatePeriodicStats() {
|
|||
{
|
||||
Statistics.Uptime = nowUpdate.Sub(Statistics.StartTime).String()
|
||||
}
|
||||
|
||||
{
|
||||
Statistics.Health.IRC = authIrcConnection.Connected()
|
||||
}
|
||||
}
|
||||
|
||||
var sysMemLastUpdate time.Time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue