mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Extract webserver metrics into a separate class to avoid passing it into every API call. Change the display to requests per hour rather than just last request time. Add SSE and telnet client connected count.
This commit is contained in:
@@ -26,6 +26,11 @@ class SSEBroadcaster:
|
||||
with self._lock:
|
||||
self._handlers.discard(handler)
|
||||
|
||||
@property
|
||||
def client_count(self) -> int:
|
||||
with self._lock:
|
||||
return len(self._handlers)
|
||||
|
||||
def publish(self, value):
|
||||
self._loop.add_callback(self._broadcast, value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user