mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-03 11:50:56 +00:00
Separate CurrentClientCount and global subs
This commit is contained in:
parent
42c82251be
commit
26ac45358e
2 changed files with 6 additions and 2 deletions
|
@ -27,6 +27,7 @@ type StatsData struct {
|
|||
}
|
||||
|
||||
CurrentClientCount uint64
|
||||
LiveClientCount uint64
|
||||
|
||||
PubSubChannelCount int
|
||||
|
||||
|
@ -81,7 +82,7 @@ func commandCounter() {
|
|||
}
|
||||
|
||||
// StatsDataVersion is the version of the StatsData struct.
|
||||
const StatsDataVersion = 6
|
||||
const StatsDataVersion = 7
|
||||
const pageSize = 4096
|
||||
|
||||
var cpuUsage struct {
|
||||
|
@ -152,7 +153,7 @@ func updatePeriodicStats() {
|
|||
|
||||
GlobalSubscriptionLock.RLock()
|
||||
|
||||
Statistics.CurrentClientCount = uint64(len(GlobalSubscriptionInfo))
|
||||
Statistics.LiveClientCount = uint64(len(GlobalSubscriptionInfo))
|
||||
versions := make(map[string]uint64)
|
||||
for _, v := range GlobalSubscriptionInfo {
|
||||
versions[v.VersionString]++
|
||||
|
|
|
@ -89,6 +89,9 @@ type ClientInfo struct {
|
|||
|
||||
Version ClientVersion
|
||||
|
||||
// Set after a successful hello message.
|
||||
HelloOK bool
|
||||
|
||||
// This mutex protects writable data in this struct.
|
||||
// If it seems to be a performance problem, we can split this.
|
||||
Mutex sync.Mutex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue