cpu usage fix
This commit is contained in:
parent
117d0483f7
commit
cffb65e37d
@ -1221,7 +1221,7 @@ function on_ws_recv(evt)
|
|||||||
break;
|
break;
|
||||||
case "cpuusage":
|
case "cpuusage":
|
||||||
var server_cpu_usage = json.value;
|
var server_cpu_usage = json.value;
|
||||||
progressbar_set(e("openwebrx-bar-server-cpu"),server_cpu_usage/100,"Server CPU [" + server_cpu_usage + "%]",server_cpu_usage>85);
|
progressbar_set(e("openwebrx-bar-server-cpu"),server_cpu_usage,"Server CPU [" + Math.round(server_cpu_usage * 100) + "%]",server_cpu_usage>85);
|
||||||
break;
|
break;
|
||||||
case "clients":
|
case "clients":
|
||||||
var clients = json.value;
|
var clients = json.value;
|
||||||
|
@ -452,8 +452,6 @@ class CpuUsageThread(threading.Thread):
|
|||||||
c.write_cpu_usage(cpu_usage)
|
c.write_cpu_usage(cpu_usage)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
logger.debug("cpu usage thread shut down")
|
logger.debug("cpu usage thread shut down")
|
||||||
if CpuUsageThread.sharedInstance == self:
|
|
||||||
CpuUsageThread.sharedInstance = None
|
|
||||||
|
|
||||||
def get_cpu_usage(self):
|
def get_cpu_usage(self):
|
||||||
try:
|
try:
|
||||||
@ -486,6 +484,7 @@ class CpuUsageThread(threading.Thread):
|
|||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
|
CpuUsageThread.sharedInstance = None
|
||||||
self.doRun = False
|
self.doRun = False
|
||||||
|
|
||||||
class ClientReportingThread(threading.Thread):
|
class ClientReportingThread(threading.Thread):
|
||||||
|
Loading…
Reference in New Issue
Block a user