rename Metric Classes and change Folder Structure

This commit is contained in:
2026-04-04 22:14:14 +02:00
parent a38a600bdc
commit 043d7654f9
7 changed files with 52 additions and 36 deletions
+21
View File
@@ -0,0 +1,21 @@
from server.metrics.backends.Template import StoreTemplate
class MemoryMetricsStore(StoreTemplate):
def __init__(self, **kwargs):
super().__init__(backend="memory", **kwargs)
self._snapshots:dict[str, dict] = {}
async def publish(self, worker_id:str, snapshot:dict) -> None:
self._snapshots[worker_id] = dict(snapshot)
async def load_all(self) -> list[dict]:
return [dict(value) for value in self._snapshots.values()]
async def clear_all(self) -> None:
self._snapshots.clear()
async def _acquire_startup_cleanup_lock(self, lock_key:str, ttl_seconds:int=300) -> bool:
return True
async def close(self) -> None:
return None