diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-04-08 12:10:55 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-04-08 12:10:55 -0400 |
commit | ff0378a21c62ca21cc3dfccf9104b96d0670a352 (patch) | |
tree | 0b328127d9c2a2f27bfcf8a583af7f18fba93224 | |
parent | d8a18ebcaef17ce81001ee8404e2a31982d9079e (diff) |
graph by number of seconds
-rw-r--r-- | get-client-cpu-mem.py | 3 | ||||
-rw-r--r-- | series-ping.py | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/get-client-cpu-mem.py b/get-client-cpu-mem.py index eeac1b2..0dd1aac 100644 --- a/get-client-cpu-mem.py +++ b/get-client-cpu-mem.py @@ -6,5 +6,4 @@ splitted = res.split() cpu = splitted[2] mem = splitted[3] -print cpu -print mem +print cpu, mem diff --git a/series-ping.py b/series-ping.py index 077c5ef..0993d08 100644 --- a/series-ping.py +++ b/series-ping.py @@ -1,5 +1,16 @@ import commands -for i in range(100): +import datetime + +POINTS = 100 + +start = datetime.datetime.now() + +for i in range(POINTS): value = commands.getoutput('python get_ping_rate.py') print "Step", i, "...", value - commands.getoutput('echo %s\t%s >> series.log' % (i, value)) + cpu_mem = commands.getoutput('python get-client-cpu-mem.py') + cpu, mem = cpu_mem.split() + now = datetime.datetime.now() + secs = (now - start).seconds + commands.getoutput( + 'echo %s\t%s\t%s\t%s >> series.log' % (secs, value, cpu, mem)) |