mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-03 16:38:31 +00:00
Expose stats on frequency of client version numbers
This commit is contained in:
parent
d7ea9d610b
commit
841b6a018d
1 changed files with 10 additions and 0 deletions
|
@ -39,6 +39,8 @@ type StatsData struct {
|
||||||
ClientConnectsTotal uint64
|
ClientConnectsTotal uint64
|
||||||
ClientDisconnectsTotal uint64
|
ClientDisconnectsTotal uint64
|
||||||
|
|
||||||
|
ClientVersions map[string]uint64
|
||||||
|
|
||||||
DisconnectCodes map[string]uint64
|
DisconnectCodes map[string]uint64
|
||||||
|
|
||||||
CommandsIssuedTotal uint64
|
CommandsIssuedTotal uint64
|
||||||
|
@ -88,6 +90,7 @@ func newStatsData() *StatsData {
|
||||||
CommandsIssuedMap: make(map[Command]uint64),
|
CommandsIssuedMap: make(map[Command]uint64),
|
||||||
DisconnectCodes: make(map[string]uint64),
|
DisconnectCodes: make(map[string]uint64),
|
||||||
DisconnectReasons: make(map[string]uint64),
|
DisconnectReasons: make(map[string]uint64),
|
||||||
|
ClientVersions: make(map[string]uint64),
|
||||||
StatsDataVersion: StatsDataVersion,
|
StatsDataVersion: StatsDataVersion,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +140,14 @@ func updatePeriodicStats() {
|
||||||
ChatSubscriptionLock.RUnlock()
|
ChatSubscriptionLock.RUnlock()
|
||||||
|
|
||||||
GlobalSubscriptionLock.RLock()
|
GlobalSubscriptionLock.RLock()
|
||||||
|
|
||||||
Statistics.CurrentClientCount = uint64(len(GlobalSubscriptionInfo))
|
Statistics.CurrentClientCount = uint64(len(GlobalSubscriptionInfo))
|
||||||
|
versions := make(map[string]uint64)
|
||||||
|
for _, v := range GlobalSubscriptionInfo {
|
||||||
|
versions[v.VersionString]++
|
||||||
|
}
|
||||||
|
Statistics.ClientVersions = versions
|
||||||
|
|
||||||
GlobalSubscriptionLock.RUnlock()
|
GlobalSubscriptionLock.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue