diff options
Diffstat (limited to 'reader/sample_script.py')
-rwxr-xr-x | reader/sample_script.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/reader/sample_script.py b/reader/sample_script.py deleted file mode 100755 index 676cfac..0000000 --- a/reader/sample_script.py +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | # This is a sample script for using the tool. I would recommend copying | ||
4 | # this and modifying it to suit your needs for a particular test. Make | ||
5 | # sure you redirect the output to a file (e.g. ./sample_script.py > output). | ||
6 | |||
7 | # Import the modules we need. You should not need to know about | ||
8 | # their internals. | ||
9 | import trace_reader | ||
10 | import sanitizer | ||
11 | import gedf_test | ||
12 | import stats | ||
13 | import stdout_printer | ||
14 | |||
15 | # Specify your trace files | ||
16 | g6 = [ | ||
17 | '../traces/st-g6-0.bin', | ||
18 | '../traces/st-g6-1.bin', | ||
19 | '../traces/st-g6-2.bin', | ||
20 | '../traces/st-g6-3.bin', | ||
21 | ] | ||
22 | |||
23 | # Here is an example of a custom filter function. | ||
24 | # It will remove from the error stream all inversion_end records indicating | ||
25 | # an inversion of less than 4000000 time units. Thus, you can grep through | ||
26 | # the output looking 'Inversion end' and find only errors for particularly | ||
27 | # long inversions. This is commented out in the pipeline (below) since you | ||
28 | # probably don't want it in general. | ||
29 | def my_filter(record): | ||
30 | if record.record_type == 'error' and record.type_name == 'inversion_end': | ||
31 | if record.job.inversion_end - record.job.inversion_start < 4000000: | ||
32 | return False | ||
33 | return True | ||
34 | |||
35 | # Pipeline | ||
36 | stream = trace_reader.trace_reader(g6) # Read events from traces | ||
37 | stream = sanitizer.sanitizer(stream) # Remove garbage events | ||
38 | stream = gedf_test.gedf_test(stream) # Produce G-EDF error records | ||
39 | stream = stats.stats(stream) # Produce a statistics record | ||
40 | #stream = filter(my_filter, stream) # Filter some records before printing | ||
41 | stdout_printer.stdout_printer(stream) # Print records to stdout | ||