funapi / routes /siteRoutes /systemInfo.py
imperialwool's picture
fin fix i guess
e7ab40f
raw
history blame
880 Bytes
import psutil
import cpuinfo
from .. import helpers
def cpu ():
v = cpuinfo.get_cpu_info()
cpu_info = {
'cpu_brand': v['brand_raw'],
'cpu_freq': {
'current': float(psutil.cpu_freq()[0]),
'min': float(psutil.cpu_freq()[1]),
'max': float(psutil.cpu_freq()[2]),
},
'cpu_count': {
'all': int(psutil.cpu_count(logical=True)),
'exclude_virtual': int(psutil.cpu_count(logical=False))
},
'cpu_load': psutil.cpu_percent()
}
return cpu_info
def mem ():
mem_info = {
'mem_total' : int(psutil.virtual_memory()[0]/1024/1024),
'mem_used' : int(psutil.virtual_memory()[3]/1024/1024)
}
return mem_info
def systemInfo():
config = helpers.configFile()
return {"CPU_INFO": cpu(), "MEM_INFO": mem(), "API_VERSION": config['buildVersion']}