#6387 TimerMiddleware doesn't work with generator functions

v1.0.0
closed
sf-1 (616)
General
2015-08-20
2013-06-24
Cory Johns
No

Testing TMW with the following generator function logs a time of 0:

def time_this(self):
    import time
    time.sleep(5)
    yield 1

More of our SCM code is using generators which are not being tracked properly and could be hiding critical points.

Discussion

  • Cory Johns - 2013-06-24
    • status: open --> code-review
    • assigned_to: Cory Johns
    • Size: --> 1
    • Milestone: forge-backlog --> forge-jun-28
     
  • Cory Johns - 2013-06-24

    timermiddleware:cj/6387

    The timings for the generator end up in timer_name.next instead of timer_name. I'd prefer the timings to go under timer_name but then the call counts would be out of whack.

     
    • QA: Tim Van Steenburgh
     
    • status: code-review --> closed
     

Log in to post a comment.