On 06/04/11 13:19, Itamar Turner-Trauring wrote:
On Wed, 2011-04-06 at 10:55 +0100, Paul Thomas wrote:
I have a reactor which is getting busier over time and I'd like to find out where the cycles are going. Using the profiler isn't really practical on a server running for days, so I'd like to instrument the reactor to show me which I/O events are taking the longest to deal with.
You may just want to wrap manual profiling code around your code's entry points (e.g. dataReceived/connectionMade/connectionLost/whatever gets callLatered). It would be nice if you could get the reactor to turn this sort of info on/off in a running system, though.
I've done this with a decorator & dictionary before, including counting time inside deferred return values separately from the original function call.