added the rpx_sessions counter

This commit is contained in:
2025-08-19 22:23:22 +09:00
parent 10c139e837
commit c001458b24
8 changed files with 43 additions and 5 deletions

View File

@ -211,6 +211,7 @@ func (rpx *server_rpx) alloc_server_rpx(cts *ServerConn, req *http.Request) (*Se
cts.rpx_map[assigned_id] = srpx
cts.rpx_mtx.Unlock()
cts.S.stats.rpx_sessions.Add(1)
return srpx, nil
}
@ -247,6 +248,7 @@ func (rpx *server_rpx) ServeHTTP(w http.ResponseWriter, req *http.Request) (int,
cts.rpx_mtx.Lock()
delete(cts.rpx_map, srpx.id)
cts.rpx_mtx.Unlock()
cts.S.stats.rpx_sessions.Add(-1)
}()
ws_upgrade = strings.EqualFold(req.Header.Get("Upgrade"), "websocket") && strings.Contains(strings.ToLower(req.Header.Get("Connection")), "upgrade");