diff options
| author | Mac Mollison <mollison@cs.unc.edu> | 2010-03-26 16:34:21 -0400 |
|---|---|---|
| committer | Mac Mollison <mollison@cs.unc.edu> | 2010-03-26 16:34:21 -0400 |
| commit | ed309ed19e2ba5d4172e886b496ca3c40c3d3634 (patch) | |
| tree | e6aa012f84ca4fb92aa744297b4d9d0aece35a2d /unit-trace | |
| parent | 13b237b07c09942b6229c23a81f200b2565475ca (diff) | |
Refactored stats module to be an output module
Previously this was an "intermediate" module. Makes more sense
to have it as an output module.
Diffstat (limited to 'unit-trace')
| -rwxr-xr-x | unit-trace | 31 |
1 files changed, 17 insertions, 14 deletions
| @@ -15,7 +15,7 @@ import unit_trace | |||
| 15 | from unit_trace import trace_reader | 15 | from unit_trace import trace_reader |
| 16 | from unit_trace import sanitizer | 16 | from unit_trace import sanitizer |
| 17 | from unit_trace import gedf_test | 17 | from unit_trace import gedf_test |
| 18 | from unit_trace import stats | 18 | from unit_trace import gedf_inversion_stat_printer |
| 19 | from unit_trace import stdout_printer | 19 | from unit_trace import stdout_printer |
| 20 | from unit_trace import viz | 20 | from unit_trace import viz |
| 21 | from unit_trace import progress | 21 | from unit_trace import progress |
| @@ -90,10 +90,6 @@ if options.progress is True: | |||
| 90 | if options.gedf is True: | 90 | if options.gedf is True: |
| 91 | stream = gedf_test.gedf_test(stream) | 91 | stream = gedf_test.gedf_test(stream) |
| 92 | 92 | ||
| 93 | # Produce a statistics record | ||
| 94 | if options.num_inversions > -1: | ||
| 95 | stream = stats.stats(stream,options.num_inversions) | ||
| 96 | |||
| 97 | # Filter some records out | 93 | # Filter some records out |
| 98 | #def my_filter(record): | 94 | #def my_filter(record): |
| 99 | # if record.record_type == 'error' and record.type_name == 'inversion_end': | 95 | # if record.record_type == 'error' and record.type_name == 'inversion_end': |
| @@ -102,13 +98,20 @@ if options.num_inversions > -1: | |||
| 102 | # return True | 98 | # return True |
| 103 | #stream = filter(my_filter, stream) | 99 | #stream = filter(my_filter, stream) |
| 104 | 100 | ||
| 105 | # Output | 101 | # Tee by the number of possible outputs |
| 106 | if options.stdout is True and options.visualize is True: | 102 | # This might cause a performance bottleneck that could be eliminated by |
| 107 | import itertools | 103 | # checking how many we actually need :-) |
| 108 | stream1, stream2 = itertools.tee(stream,2) | 104 | import itertools |
| 105 | stream1, stream2, stream3 = itertools.tee(stream,3) | ||
| 106 | |||
| 107 | # Call standard out printer | ||
| 108 | if options.stdout is True: | ||
| 109 | stdout_printer.stdout_printer(stream1) | 109 | stdout_printer.stdout_printer(stream1) |
| 110 | viz.visualizer.visualizer(stream2) | 110 | |
| 111 | elif options.stdout is True: | 111 | # Print G_EDF inversion statistics |
| 112 | stdout_printer.stdout_printer(stream) | 112 | if options.num_inversions > -1: |
| 113 | elif options.visualize is True: | 113 | gedf_inversion_stat_printer.gedf_inversion_stat_printer(stream2,options.num_inversions) |
| 114 | viz.visualizer.visualizer(stream) | 114 | |
| 115 | # Call visualizer | ||
| 116 | if options.visualize is True: | ||
| 117 | viz.visualizer.visualizer(stream3) | ||
