diff --git a/socketserver/server/stats.go b/socketserver/server/stats.go index a9401248..8502a83e 100644 --- a/socketserver/server/stats.go +++ b/socketserver/server/stats.go @@ -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]++ diff --git a/socketserver/server/types.go b/socketserver/server/types.go index 365b91b6..1048434c 100644 --- a/socketserver/server/types.go +++ b/socketserver/server/types.go @@ -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