Skip to content
Browse files

Converted batchMins to float

  • Loading branch information...
1 parent 94dd306 commit c015528dd8a10e109c89687cd2333c9eba328832 Roger Hoover committed Jun 30, 2011
Showing with 5 additions and 5 deletions.
  1. +3 −3 superlance/process_state_monitor.py
  2. +2 −2 superlance/tests/process_state_monitor_test.py
View
6 superlance/process_state_monitor.py
@@ -35,7 +35,7 @@ def __init__(self, **kwargs):
self.stderr = kwargs.get('stderr', sys.stderr)
self.batchMsgs = []
- self.batchMins = 0
+ self.batchMins = 0.0
def run(self):
while 1:
@@ -62,7 +62,7 @@ def getProcessStateChangeMsg(self, headers, payload):
return None
def handleTick60Event(self, headers, payload):
- self.batchMins += 1
+ self.batchMins += 1.0
if self.batchMins >= self.interval:
self.sendBatchNotification()
self.clearBatch()
@@ -80,7 +80,7 @@ def getBatchMsgs(self):
return self.batchMsgs
def clearBatch(self):
- self.batchMins = 0;
+ self.batchMins = 0.0;
self.batchMsgs = [];
def writeToStderr(self, msg):
View
4 superlance/tests/process_state_monitor_test.py
@@ -82,9 +82,9 @@ def test_handleEvent_tick_interval_not_expired(self):
monitor = self._makeOneMocked(interval=3)
hdrs, payload = self.getTick60Event()
monitor.handleEvent(hdrs, payload)
- self.assertEquals(1, monitor.getBatchMinutes())
+ self.assertEquals(1.0, monitor.getBatchMinutes())
monitor.handleEvent(hdrs, payload)
- self.assertEquals(2, monitor.getBatchMinutes())
+ self.assertEquals(2.0, monitor.getBatchMinutes())
if __name__ == '__main__':
unittest.main()

0 comments on commit c015528

Please sign in to comment.
Something went wrong with that request. Please try again.