From 79b324549d949019e450497bf0128e1853c4a8d3 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 26 Aug 2024 21:05:09 +0500 Subject: [PATCH] Report app names --- src/middlewared/middlewared/plugins/apps/stats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/middlewared/middlewared/plugins/apps/stats.py b/src/middlewared/middlewared/plugins/apps/stats.py index 6df0bf410cf8d..98a7c7d4733fd 100644 --- a/src/middlewared/middlewared/plugins/apps/stats.py +++ b/src/middlewared/middlewared/plugins/apps/stats.py @@ -6,6 +6,7 @@ from middlewared.validators import Range from .ix_apps.docker.stats import list_resources_stats_by_project +from .ix_apps.utils import get_app_name_from_project_name class AppStatsEventSource(EventSource): @@ -27,7 +28,10 @@ def run_sync(self): interval = self.arg['interval'] while not self._cancel_sync.is_set(): - self.send_event('ADDED', fields=list_resources_stats_by_project()) + self.send_event('ADDED', fields={ + get_app_name_from_project_name(project_name): stats + for project_name, stats in list_resources_stats_by_project().items() + }) time.sleep(interval)