Skip to content

Commit

Permalink
Report app names
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Aug 28, 2024
1 parent e9481f6 commit 79b3245
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/middlewared/middlewared/plugins/apps/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)


Expand Down

0 comments on commit 79b3245

Please sign in to comment.