diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-26 20:39:14 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-26 20:39:14 -0500 |
commit | e5931e397619be9db804278bd7878caedd94364a (patch) | |
tree | 27474939cdf38f557564d628721eb364b95534ef /parse/sched.py | |
parent | daba296e6e32407e335fdfca53b6d836e2029cb6 (diff) | |
parent | 8f00a88beeead3e39a07c0cc4fae8c26496196fd (diff) |
Merge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/experiment-scripts into wip-ecrts14-pgm
Diffstat (limited to 'parse/sched.py')
-rw-r--r-- | parse/sched.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parse/sched.py b/parse/sched.py index d773c8a..83004f2 100644 --- a/parse/sched.py +++ b/parse/sched.py | |||
@@ -13,7 +13,7 @@ from heapq import * | |||
13 | 13 | ||
14 | class TimeTracker: | 14 | class TimeTracker: |
15 | '''Store stats for durations of time demarcated by sched_trace records.''' | 15 | '''Store stats for durations of time demarcated by sched_trace records.''' |
16 | def __init__(self, is_valid_duration = lambda x: True, delay_buffer_size = 1, max_pending = 100): | 16 | def __init__(self, is_valid_duration = lambda x: True, delay_buffer_size = 1, max_pending = -1): |
17 | self.validator = is_valid_duration | 17 | self.validator = is_valid_duration |
18 | self.avg = self.max = self.num = 0 | 18 | self.avg = self.max = self.num = 0 |
19 | 19 | ||
@@ -51,13 +51,13 @@ class TimeTracker: | |||
51 | # Give up on some jobs if they've been hanging around too long. | 51 | # Give up on some jobs if they've been hanging around too long. |
52 | # While not strictly needed, it helps improve performance and | 52 | # While not strictly needed, it helps improve performance and |
53 | # it is unlikey to cause too much trouble. | 53 | # it is unlikey to cause too much trouble. |
54 | if(len(self.start_records) > self.max_pending): | 54 | if(self.max_pending >= 0 and len(self.start_records) > self.max_pending): |
55 | to_discard = len(self.start_records) - self.max_pending | 55 | to_discard = len(self.start_records) - self.max_pending |
56 | for i in range(to_discard): | 56 | for i in range(to_discard): |
57 | # pop off the oldest jobs | 57 | # pop off the oldest jobs |
58 | del self.start_records[self.start_records.iterkeys().next()] | 58 | del self.start_records[self.start_records.iterkeys().next()] |
59 | self.discarded += to_discard | 59 | self.discarded += to_discard |
60 | if(len(self.end_records) > self.max_pending): | 60 | if(self.max_pending >= 0 and len(self.end_records) > self.max_pending): |
61 | to_discard = len(self.end_records) - self.max_pending | 61 | to_discard = len(self.end_records) - self.max_pending |
62 | for i in range(to_discard): | 62 | for i in range(to_discard): |
63 | # pop off the oldest jobs | 63 | # pop off the oldest jobs |