# Overview

========= Summary ========= A simple hack that can turn out to be useful someday. (For use with python twisted) It strives to make twisted debugging easy. For now it can: #) track deferred creation #) track when call/errback is attached to the deferred #) track when call/errback has executed or failed to execute #) track when a deferred is chained to another deferred ========= Example ========= .. note:: The following is just a summary. The real thing is hosted at https://reactor-track-documentation.readthedocs.org/ (or if you are a real man, build it yourself in doc/) Let's look at example.py - We first create a json monitor which means that when we receive an event like deferredTracked json output with the event is appended to buffer which we could write to a file. .. code:: python monitor = JSONMonitor(True) After that call track on objects of interest: .. code:: python monitor.track(d) .. code:: python f = open("mon.out", "w") for line in monitor.buffer: f.write("{0}\n".format(line)) f.close() Write everything to a file after reactor shuts down. 1) Run python example.py (Kill it with Ctrl+C or something) This will create the file mon.out. 2) After which run cat mon.out | python reactortrack/monitor2model.py - This will produce a squaremap representation of the deferred. 3) Finally traverse line-by-line the events with Debug->Next line or CTRL+N .. TODO Move 'chained' to track method. Options for every objects depending on type. Make parser more efficient by only modifying the existing model not creating a new one every time.