From 3908d5129e42008139ee5d5fa20ae756e31c6049 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 21 Jun 2023 19:36:51 +0200 Subject: [PATCH] feat: improved error message --- src/de/p1st/monitor/loggers/memory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/p1st/monitor/loggers/memory.py b/src/de/p1st/monitor/loggers/memory.py index dfeb8cf..01f6b9d 100644 --- a/src/de/p1st/monitor/loggers/memory.py +++ b/src/de/p1st/monitor/loggers/memory.py @@ -25,9 +25,8 @@ class MemoryLogger(Logger): def get_warn_data(self, data: list[any]) -> WarnData: used_mb = data[1] total_available_mb = data[3] - message = f'Memory usage ist at {used_mb} MB of {total_available_mb} MB' - used = used_mb / total_available_mb + message = f'Memory usage ist at {used_mb} MB of {total_available_mb} MB ({round(used*100,2)}%)' return WarnData(data[0], used, message) def read_data(self) -> list[any]: