diff options
author | Susan LoVerso <sue@wiredtiger.com> | 2014-11-26 15:11:22 -0500 |
---|---|---|
committer | Susan LoVerso <sue@wiredtiger.com> | 2014-11-26 15:11:22 -0500 |
commit | 19f7180a6a0ef2ad96d83086bf36c6acc315dd45 (patch) | |
tree | b8065a87473d434e4ba2552334d82bf1a19d654e /tools | |
parent | 7b7331dad6ce69773d5418b0fb6cb1d8f7a042df (diff) | |
download | mongo-19f7180a6a0ef2ad96d83086bf36c6acc315dd45.tar.gz |
First pass at adding groupings for stats. #1365
Diffstat (limited to 'tools')
-rw-r--r-- | tools/stat_data.py | 1 | ||||
-rw-r--r-- | tools/wtstats.py | 25 |
2 files changed, 20 insertions, 6 deletions
diff --git a/tools/stat_data.py b/tools/stat_data.py index afa707c05b6..e596fc014e7 100644 --- a/tools/stat_data.py +++ b/tools/stat_data.py @@ -87,3 +87,4 @@ prefix_list = [ 'btree', 'compression', ] +groups = {'cursor': ['cursor', 'session'], 'lsm': ['LSM', 'transaction'], 'system': ['connection', 'data-handle', 'session'], 'evict': ['cache', 'connection', 'block-manager'], 'memory': ['cache', 'connection', 'reconciliation']}
\ No newline at end of file diff --git a/tools/wtstats.py b/tools/wtstats.py index 6f38e1d7c0d..249da3c4324 100644 --- a/tools/wtstats.py +++ b/tools/wtstats.py @@ -39,7 +39,8 @@ tool_dir = os.path.split(sys.argv[0])[0] sys.path = [ os.path.join(tool_dir, "3rdparty") ] + sys.path try: - from stat_data import no_scale_per_second_list, no_clear_list, prefix_list + from stat_data \ + import groups, no_scale_per_second_list, no_clear_list, prefix_list except ImportError: print >>sys.stderr, "Could not import stat_data.py, it should be\ in the same directory as %s" % sys.argv[0] @@ -190,25 +191,35 @@ def common_suffix(a, b): b = b[1:] return b -def output_series(results, prefix=None): +def output_series(results, prefix=None, grouplist=[]): # open the output file based on prefix if prefix == None: outputname = args.output + '.html' - else: + elif len(grouplist) == 0: outputname = args.output +'.' + prefix + '.html' + else: + outputname = args.output +'.group.' + prefix + '.html' - if prefix != None: + if prefix != None and len(grouplist) == 0: this_series = [] for title, yaxis, ydata in results: if not prefix in title: continue - # print 'Appending to dataset: ' + title + #print 'Appending to dataset: ' + title this_series.append((title, yaxis, ydata)) + elif prefix != None and len(grouplist) > 0: + this_series = [] + for title, yaxis, ydata in results: + for subgroup in grouplist: + if not subgroup in title: + continue + # print 'Appending to dataset: ' + title + this_series.append((title, yaxis, ydata)) else: this_series = results if len(this_series) == 0: - print 'Prefix: ' + prefix + ' has no data' + print 'Output: ' + outputname + ' has no data. Do not create.' return #--------------------------------------- @@ -284,3 +295,5 @@ output_series(results) if args.all: for prefix in prefix_list: output_series(results, prefix) + for group in groups.keys(): + output_series(results, group, groups[group]) |