Scripts needed for automation of learning process ... Tested on Sypet benchmark ...
[satune.git] / src / Scripts / serverstatus.py
1 import psutil
2 from time import sleep
3 # gives a single float value
4 avg = 0.0
5 count = 0
6 for i in range(350):
7         avg = (psutil.cpu_percent() + avg*count)/(count+1)
8         count = count + 1
9         sleep(0.1)
10
11
12 if avg> 15:
13         print "BUSY"
14 else:
15         print "AVAILABLE"