.BANCHO. .FIX. Fixed and edited !system status

This commit is contained in:
Nyo 2016-06-09 10:51:13 +02:00
parent 4a1d1c6f0e
commit 8c55604c1d
2 changed files with 8 additions and 8 deletions

View File

@ -307,18 +307,18 @@ def systemStatus(fro, chan, message):
data = systemHelper.getSystemInfo()
# Final message
msg = "=== PEP.PY STATS ===\n"
msg += "Running pep.py server\n"
msg += "Webserver: {}\n".format(data["webServer"])
msg = "pep.py bancho server v{}\n".format(glob.VERSION)
msg += "made by the Ripple team\n"
msg += "\n"
msg += "=== BANCHO STATS ===\n"
msg += "Connected users: {}\n".format(str(data["connectedUsers"]))
msg += "Connected users: {}\n".format(data["connectedUsers"])
msg += "Multiplayer matches: {}\n".format(data["matches"])
msg += "\n"
msg += "=== SYSTEM STATS ===\n"
msg += "CPU: {}%\n".format(str(data["cpuUsage"]))
msg += "RAM: {}GB/{}GB\n".format(str(data["usedMemory"]), str(data["totalMemory"]))
msg += "CPU: {}%\n".format(data["cpuUsage"])
msg += "RAM: {}GB/{}GB\n".format(data["usedMemory"], data["totalMemory"])
if data["unix"] == True:
msg += "Load average: {}/{}/{}\n".format(str(data["loadAverage"][0]), str(data["loadAverage"][1]), str(data["loadAverage"][2]))
msg += "Load average: {}/{}/{}\n".format(data["loadAverage"][0], data["loadAverage"][1], data["loadAverage"][2])
return msg

View File

@ -75,7 +75,7 @@ def getSystemInfo():
# General stats
data["connectedUsers"] = len(glob.tokens.tokens)
data["webServer"] = glob.conf.config["server"]["server"]
data["matches"] = len(glob.matches.matches)
data["cpuUsage"] = psutil.cpu_percent()
data["totalMemory"] = "{0:.2f}".format(psutil.virtual_memory()[0]/1074000000)
data["usedMemory"] = "{0:.2f}".format(psutil.virtual_memory()[3]/1074000000)