Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c155e124fa
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.751 kb
import threading, time, os, sys
class ProfilingThread(threading.Thread):
daemon = True
def __init__(self, ioloop):
self.ioloop = ioloop
threading.Thread.__init__(self)
def run(self):
pid = os.getpid()
outfile_path = os.path.abspath('profdata-{0}.log'.format(pid))
print outfile_path
sys.stdout.flush()
outfile = open(outfile_path, 'w')
while True:
handler_len = len(self.ioloop._handlers)
event_len = len(self.ioloop._events)
callback_len = len(self.ioloop._callbacks)
print >> outfile, ', '.join([str(time.time()), str(handler_len), str(event_len), str(callback_len)])
outfile.flush()
time.sleep(5)
Jump to Line
Something went wrong with that request. Please try again.