mirror of
https://codeberg.org/privacy1st/de-p1st-monitor
synced 2024-11-21 19:33:18 +01:00
feat: improved error message
This commit is contained in:
parent
c760ce3a98
commit
3908d5129e
@ -25,9 +25,8 @@ class MemoryLogger(Logger):
|
|||||||
def get_warn_data(self, data: list[any]) -> WarnData:
|
def get_warn_data(self, data: list[any]) -> WarnData:
|
||||||
used_mb = data[1]
|
used_mb = data[1]
|
||||||
total_available_mb = data[3]
|
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
|
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)
|
return WarnData(data[0], used, message)
|
||||||
|
|
||||||
def read_data(self) -> list[any]:
|
def read_data(self) -> list[any]:
|
||||||
|
Loading…
Reference in New Issue
Block a user