mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-16 11:18:05 +08:00
BUG: Fix extra minutely performance period during minute performance.
Prevent an extra performance result with the timestamp of the midnight of the day from being emitted. Fix by setting the `saved_dt` value with the dt of the first event, before entering into the main performance loop, otherwise a performance result with a midnight timestamp and data from just the first event is emitted.
This commit is contained in:
@@ -1075,3 +1075,12 @@ class TestPerformanceTracker(unittest.TestCase):
|
||||
# Check that transactions aren't emitted for previous events.
|
||||
self.assertEquals(0, len(messages[1]['intraday_perf']['transactions']),
|
||||
"The second message should have no transactions.")
|
||||
|
||||
# Ensure that period_close moves through time.
|
||||
# Also, ensure that the period_closes are the expected dts.
|
||||
self.assertEquals(foo_event_1.dt,
|
||||
messages[0]['intraday_perf']['period_close'],
|
||||
messages[0])
|
||||
self.assertEquals(foo_event_2.dt,
|
||||
messages[1]['intraday_perf']['period_close'],
|
||||
messages[1])
|
||||
|
||||
Reference in New Issue
Block a user