Improve platform status

This commit is contained in:
世界
2023-07-16 14:08:45 +08:00
parent f9ebe73e60
commit 08481d4ecb
4 changed files with 45 additions and 6 deletions

View File

@@ -55,6 +55,14 @@ func (m *Manager) Now() (up int64, down int64) {
return m.uploadBlip.Load(), m.downloadBlip.Load()
}
func (m *Manager) Total() (up int64, down int64) {
return m.uploadTotal.Load(), m.downloadTotal.Load()
}
func (m *Manager) Connections() int {
return m.connections.Len()
}
func (m *Manager) Snapshot() *Snapshot {
var connections []tracker
m.connections.Range(func(_ string, value tracker) bool {