mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-06-18 20:48:28 +03:00
Pool for cloudflare worker
This commit is contained in:
@@ -14,11 +14,16 @@ class _Stats:
|
||||
self.bytes_down = 0
|
||||
self.pool_hits = 0
|
||||
self.pool_misses = 0
|
||||
self.cf_pool_hits = 0
|
||||
self.cf_pool_misses = 0
|
||||
|
||||
def summary(self) -> str:
|
||||
pool_total = self.pool_hits + self.pool_misses
|
||||
pool_s = (f"{self.pool_hits}/{pool_total}"
|
||||
if pool_total else "n/a")
|
||||
cf_pool_total = self.cf_pool_hits + self.cf_pool_misses
|
||||
cf_pool_s = (f"{self.cf_pool_hits}/{cf_pool_total}"
|
||||
if cf_pool_total else "n/a")
|
||||
return (f"total={self.connections_total} "
|
||||
f"active={self.connections_active} "
|
||||
f"ws={self.connections_ws} "
|
||||
@@ -28,6 +33,7 @@ class _Stats:
|
||||
f"masked={self.connections_masked} "
|
||||
f"err={self.ws_errors} "
|
||||
f"pool={pool_s} "
|
||||
f"cf_pool={cf_pool_s} "
|
||||
f"up={human_bytes(self.bytes_up)} "
|
||||
f"down={human_bytes(self.bytes_down)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user