diff --git a/scripts/replay-curtin-log.py b/scripts/replay-curtin-log.py index 358f5a7a..6f1b0570 100644 --- a/scripts/replay-curtin-log.py +++ b/scripts/replay-curtin-log.py @@ -36,8 +36,12 @@ class FakeEvent: def as_dict(self): return self._ev_dict +prev_ev = None for line in open(json_file): d = json.loads(line.strip()) ev = FakeEvent(d) - events.report_event(ev) - time.sleep(random.expovariate(2)) + if prev_ev is not None: + events.report_event(prev_ev) + time.sleep(min((ev.timestamp - prev_ev.timestamp)/4, 2)) + prev_ev = ev +events.report_event(prev_ev)