Browse Source

a bit of code cleanup

windows
Florian N 12 years ago
parent
commit
bd775a7ed3
  1. 16
      main/views.py

16
main/views.py

@ -178,22 +178,6 @@ def get_mem():
return data
#def getcpu_usage():
# try:
# pipe = os.popen("ps aux |" + "awk {'sum+=$3;print sum'} |" + "tail -n 1")
# data = pipe.read().strip()
# pipe.close()
# cpu_free = (100 - float(data))
# cpu_used = {'free': cpu_free, 'used': float(data)}
# data = cpu_used
# except Exception,err:
# data = str(err)
#
# return data
def get_cpu_usage():
try:
pipe = os.popen("ps aux --sort -%cpu,-rss")

Loading…
Cancel
Save