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:
Eddie Hebert
2013-04-10 10:51:39 -04:00
parent 5a7039ab93
commit e03d51f0bc
2 changed files with 20 additions and 1 deletions
+9
View File
@@ -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])