Skip to content

Commit acb028f

Browse files
author
Andrei Neagu
committed
refactor fo redability
1 parent 5ceffe8 commit acb028f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/system_monitor/_disk_usage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ def _normalized_monitored_paths(self) -> dict[MountPathCategory, set[str]]:
9191
for k, paths in self.monitored_paths.items()
9292
}
9393

94-
async def _publish_disk_usage(self, usage: dict[str, DiskUsage]):
95-
await publish_disk_usage(
96-
self.app, user_id=self.user_id, node_id=self.node_id, usage=usage
97-
)
98-
9994
async def _get_measured_disk_usage(self) -> list[DiskUsage]:
10095
return await logged_gather(
10196
*[
@@ -136,6 +131,11 @@ def _get_grouped_usage_to_folder_names(
136131
usage_to_folder_names[disk_usage].add(folder_name)
137132
return usage_to_folder_names
138133

134+
async def _publish_disk_usage(self, usage: dict[str, DiskUsage]):
135+
await publish_disk_usage(
136+
self.app, user_id=self.user_id, node_id=self.node_id, usage=usage
137+
)
138+
139139
async def _monitor(self) -> None:
140140
measured_disk_usage = await self._get_measured_disk_usage()
141141

services/dynamic-sidecar/tests/unit/test_modules_system_monitor__disk_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ async def _wait_for_usage() -> dict[str, DiskUsage]:
209209
publish_disk_usage_spy.assert_called()
210210
return publish_disk_usage_spy.call_args_list[0][0][0]
211211

212-
# normally only 1 value is found
212+
# normally only 1 entry is found
213213
frontend_usage = await _wait_for_usage()
214214
print(json_dumps(frontend_usage, indent=2))
215215
assert len(frontend_usage) == 1
@@ -218,7 +218,7 @@ async def _wait_for_usage() -> dict[str, DiskUsage]:
218218
"1294390525952"
219219
)
220220

221-
# emulate EFS
221+
# emulate EFS sending metrics, 2 entries are found
222222

223223
disk_usage_monitor.set_disk_usage_for_path(
224224
{

0 commit comments

Comments
 (0)