API: Add user online stats (#3637)

* add statsUserOnline bool to policy

* add OnlineMap struct to stats

* apply UserOnline functionality to dispatcher

* add statsonline api command

* fix comments

* Update app/stats/online_map.go

Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>

* improve AddIP

* regenerate pb

---------

Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
This commit is contained in:
Hossin Asaadi 2024-11-03 17:44:15 +04:00 committed by GitHub
parent e3276df725
commit 2c72864935
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 575 additions and 177 deletions

View file

@ -73,6 +73,7 @@ func (p *Policy) ToCorePolicy() policy.Session {
if p.Stats != nil {
cp.Stats.UserUplink = p.Stats.UserUplink
cp.Stats.UserDownlink = p.Stats.UserDownlink
cp.Stats.UserOnline = p.Stats.UserOnline
}
if p.Buffer != nil {
cp.Buffer.PerConnection = p.Buffer.Connection