[Twisted-Python] Instrumenting Reactors

Itamar Turner-Trauring itamar at itamarst.org
Wed Apr 6 06:19:46 MDT 2011


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.





More information about the Twisted-Python mailing list