mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-08 00:26:32 +02:00
Include load in stats response.
This commit is contained in:
parent
7d690d049f
commit
644d9a1737
|
@ -948,6 +948,7 @@ func (s *ProxyServer) GetClientId(client signaling.McuClient) string {
|
|||
func (s *ProxyServer) getStats() map[string]interface{} {
|
||||
result := map[string]interface{}{
|
||||
"sessions": s.GetSessionsCount(),
|
||||
"load": atomic.LoadInt64(&s.load),
|
||||
"mcu": s.mcu.GetStats(),
|
||||
}
|
||||
return result
|
||||
|
|
|
@ -317,6 +317,8 @@ type mcuProxyConnectionStats struct {
|
|||
Connected bool `json:"connected"`
|
||||
Publishers int64 `json:"publishers"`
|
||||
Clients int64 `json:"clients"`
|
||||
Load *int64 `json:"load,omitempty"`
|
||||
Shutdown *bool `json:"shutdown,omitempty"`
|
||||
Uptime *time.Time `json:"uptime,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -328,6 +330,10 @@ func (c *mcuProxyConnection) GetStats() *mcuProxyConnectionStats {
|
|||
if c.conn != nil {
|
||||
result.Connected = true
|
||||
result.Uptime = &c.connectedSince
|
||||
load := c.Load()
|
||||
result.Load = &load
|
||||
shutdown := c.IsShutdownScheduled()
|
||||
result.Shutdown = &shutdown
|
||||
}
|
||||
c.mu.Unlock()
|
||||
c.publishersLock.RLock()
|
||||
|
|
Loading…
Reference in a new issue