Skip to content

Instantly share code, notes, and snippets.

View leamingrad's full-sized avatar

James Owen leamingrad

  • London, United Kingdom
View GitHub Profile
@leamingrad
leamingrad / flames.py
Last active April 15, 2021 08:31 — forked from elmehalawi/flames.py
Flamegraph django middleware
"""
Django middleware for generating request flame graphs.
Requires the flamegraph.pl perl script:
https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl
Installation:
1. Create a directory for flame graphs
2. Copy the flamegraph.pl script to it
3. Add the FLAMES_DIR django setting
4. Add the flames.FlamesMiddleware to MIDDLEWARE_CLASSES