Git Product home page Git Product logo

plop's Introduction

Plop: Python Low-Overhead Profiler

Plop is a stack-sampling profiler for Python. Profile collection can be turned on and off in a live process with minimal performance impact.

Plop is currently a work in progress and pretty rough around the edges, so be prepared to run into bugs and extremely unrefined interfaces (which are likely to change in backwards-incompatible ways in future releases).

Installation

pip install plop

Prerequisites

The plop.collector module runs on Python 2.5, 2.6, and 2.7 on Unixy platforms including Linux, BSD and Mac OS X (must support the setitimer system call). The plop.viewer module requires Python 2.7 and Tornado 2.x. The viewer can be (and usually is) run separately from the collector.

Usage

In the application to be profiled, create a plop.collector.Collector, call start(), wait, then stop(). Dump collector.stack_counts to a file. See ProfileHandler in demo/busy_server.py for an example of how to trigger profiling via an HTTP interface.

To use the viewer, run:

python -m plop.viewer --datadir=demo/profiles

and go to http://localhost:8888

Example

An end-to-end demo is available in the demo directory. create_profile.sh will run a server (which talks to itself to generate load), generate a profile, and shut it down. view_profile.sh will run the viewer app.

More info

The source code is hosted at https://github.com/bdarnell/plop

plop's People

Contributors

bdarnell avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.