mirror of
https://github.com/unixtensor/proxmox-ntfy.git
synced 2025-06-27 23:28:05 +00:00
mem.py
This commit is contained in:
15
src/mem.py
Normal file
15
src/mem.py
Normal file
@ -0,0 +1,15 @@
|
||||
import psutil
|
||||
import math
|
||||
|
||||
peak: float = 0
|
||||
check: int = 3600 # Seconds
|
||||
|
||||
def usage() -> float:
|
||||
global peak
|
||||
mem = round(psutil.virtual_memory().used / 1048576000, 1)
|
||||
if mem > peak:
|
||||
peak = mem
|
||||
return mem
|
||||
|
||||
def total() -> int:
|
||||
return math.floor(psutil.virtual_memory().total / 1048576000)
|
Reference in New Issue
Block a user