diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-04-03 15:16:40 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-04-25 15:54:34 +0200 |
commit | 9dd5de26351bffa5d7d31d120cf8dec90e3932a6 (patch) | |
tree | e0991e0b41004eb356b2c6e89231b736366bc380 /src/script | |
parent | perf-watch.py: fix naming of local variable (diff) | |
download | ceph-9dd5de26351bffa5d7d31d120cf8dec90e3932a6.tar.xz ceph-9dd5de26351bffa5d7d31d120cf8dec90e3932a6.zip |
perf-watch.py: fix naming of a local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'src/script')
-rwxr-xr-x | src/script/perf-watch.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/script/perf-watch.py b/src/script/perf-watch.py index b6634f9b9b4..8c18c3ec766 100755 --- a/src/script/perf-watch.py +++ b/src/script/perf-watch.py @@ -92,9 +92,9 @@ def main(): print_count += 1 (code, raw) = commands.getstatusoutput('./ceph --admin-daemon %s perf dump' % ctx.socket) - r = json.loads(raw) + perfstats = json.loads(raw) if prev is None: - prev = r + prev = perfstats vline = ' ' now = time.time() @@ -106,7 +106,7 @@ def main(): for v in vars: (sec, var) = v.split('.') val = 0 - if sec in r and var in r[sec]: + if sec in perfstats and var in perfstats[sec]: formatstr = '%' + str(max(len(v), 8)) if vartype[v] & 1: @@ -116,18 +116,18 @@ def main(): val = 0 if vartype[v] & 4: - den = (r[sec][var]['avgcount'] - r[sec][var]['avgcount']) + den = (perfstats[sec][var]['avgcount'] - perfstats[sec][var]['avgcount']) if den > 0: - val = (r[sec][var]['sum'] - prev[sec][var]['sum']) / den + val = (perfstats[sec][var]['sum'] - prev[sec][var]['sum']) / den elif vartype[v] & 8: - val = r[sec][var] - prev[sec][var] + val = perfstats[sec][var] - prev[sec][var] else: - val = r[sec][var] + val = perfstats[sec][var] vline = vline + ' ' + (formatstr % val) print(vline) - prev = r + prev = perfstats time.sleep(1) |