Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

modified to consume new daemon data structure

-client works and now handles multiple cpus
-GUI is now broken but has code in place to be fixed, but I can't test, sorry
  • Loading branch information...
commit f14c79b84fb7a5a3f46b2a8267fdc216e3f3d906 1 parent 4a4eb60
Dan Ballard authored April 10, 2012

Showing 2 changed files with 20 additions and 7 deletions. Show diff stats Hide diff stats

  1. 15  cmdline.py
  2. 12  main.py
15  cmdline.py
@@ -12,16 +12,21 @@
12 12
 		sock.close()
13 13
 		#print data
14 14
 		stats = json.loads(data)
15  
-		for stat in stats["Stats"]:
16  
-			print "%s: %f" % (stat["type"] ,stat["value"])
  15
+		for k in stats:
  16
+			v = stats[k]
  17
+			if type(v) is list:
  18
+				for i in range(0,len(v)):
  19
+					print "%s[%d]: %f" % (k, i, v[i]['percent'])
  20
+			else :
  21
+				print "%s: %f" % (k,v['percent'])
17 22
 		print "----"
18 23
 		time.sleep(1)
19 24
 	except KeyboardInterrupt:
20 25
 		print "\nExiting..."
21 26
 		break
22  
-	except:
23  
-		print "\nError..."
24  
-		break
  27
+#	except Exception as err:
  28
+#		print "\nError ", type(err), ': ', err, "..."
  29
+#		break
25 30
 
26 31
 
27 32
 
12  main.py
@@ -55,8 +55,16 @@ def on_timeout(self, data):
55 55
 		sock.close()
56 56
 		#print data
57 57
 		stats = json.loads(data)
58  
-		for stat in stats["Stats"]:
59  
-			self.stats[stat["type"]].set_label("%f"%stat["value"])
  58
+		#for stat in stats["Stats"]:
  59
+		#	self.stats[stat["type"]].set_label("%f"%stat["value"])
  60
+		for k in stats:
  61
+                        v = stats[k]
  62
+                        if type(v) is list:
  63
+                                for i in range(0,len(v)):
  64
+                                        print "%s[%d]: %f" % (k, i, v[i]['percent'])
  65
+                        else :
  66
+                                print "%s: %f" % (k,v['percent'])
  67
+
60 68
 		return True
61 69
 
62 70
 

0 notes on commit f14c79b

Please sign in to comment.
Something went wrong with that request. Please try again.