This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

twisted-theseus

A Deferred-aware profiler for Python code.

While cProfile is a very useful utility, it is limited to recording synchronous execution time. A function that returns a Deferred will typically return very quickly, while the Deferred it returns might not fire for seconds or even minutes. This is where theseus comes in: any function that returns a Deferred will be tracked by theseus. The time from when the Deferred was returned to when it fired will be measured, and recorded along with the function’s call stack.

Usage

The public interface of theseus is a class called Tracer. To get started:

from theseus import Tracer
t = Tracer()
t.install()

This is enough to start tracing execution. Eventually, the statistics will have to be written to disk:

with open('callgrind.theseus', 'wb') as outfile:
  t.write_data(outfile)

The output is written in callgrind format, which means that standard tools can be used to interpret the results, such as kcachegrind.

If at any point the Tracer is no longer useful, it can be uninstalled to stop tracing:

t.uninstall()

Additionally, theseus is aware of inlineCallbacks, and will rewrite call stacks to make them look “correct”. For example, given this code:

from twisted.internet import defer, task

@defer.inlineCallbacks
def func(reactor):
  yield task.deferLater(reactor, 1, lambda: None)

task.react(func)

The call stack according to theseus will look like this (most recent call last):

__main__ in <module>
twisted.internet.task in react
__main__ in func

While theseus and cProfile both use a profile hook, as long as cProfile is installed first, both profilers can be used at the same time. In this case, calling uninstall() will restore cProfile.

Release History

Release History

0.14.1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.14.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.14.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.14.0.0a1.post3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
twisted_theseus-0.14.1.3-pp27-none-any.whl (9.3 kB) Copy SHA256 Checksum SHA256 pp27 Wheel Oct 29, 2015
twisted-theseus-0.14.1.3.tar.gz (28.9 kB) Copy SHA256 Checksum SHA256 Source Oct 29, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting