mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-06-19 04:51:08 +03:00
feat(android): show proxy traffic stats in foreground notification
This commit is contained in:
@@ -492,6 +492,21 @@ class Stats:
|
||||
_stats = Stats()
|
||||
|
||||
|
||||
def reset_stats() -> None:
|
||||
global _stats
|
||||
_stats = Stats()
|
||||
|
||||
|
||||
def get_stats_snapshot() -> Dict[str, int]:
|
||||
return {
|
||||
"bytes_up": _stats.bytes_up,
|
||||
"bytes_down": _stats.bytes_down,
|
||||
"connections_total": _stats.connections_total,
|
||||
"connections_ws": _stats.connections_ws,
|
||||
"connections_tcp_fallback": _stats.connections_tcp_fallback,
|
||||
}
|
||||
|
||||
|
||||
class _WsPool:
|
||||
def __init__(self):
|
||||
self._idle: Dict[Tuple[int, bool], list] = {}
|
||||
|
||||
Reference in New Issue
Block a user