lundberg / django-analyzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Analyzer

A set of tools to profile django and python applications.

Configuration

  1. Set DEBUG to True in your Django settings

  2. Add django_analyzer to your INSTALLED_APPS setting so Django can find the template files associated with the Debug Toolbar:

    INSTALLED_APPS = (
        ...
        'django_analyzer',
    )
    

Analyzer

The analyzer uses middlewares and an optional template tag to measure time spent on different parts of a Django request:

  1. Request total time
  2. Middlewares request time
  3. View execution time
  4. Template rendering time
  5. Middlewares response time

Configuration

  1. The timeline is shown in a debug toolbar panel, add the following panel to your toolbar config:

    DEBUG_TOOLBAR_PANELS = (
        # ...
        'django_analyzer.toolbar.panels.ProfilingDebugPanel',
    )
    

Usage

Optionally you can precise your timing stats by wrapping parts of your template code with the measure template tag, name the block by passing a name/label token:

{% load monkey_analyzer %}
{% measure slowstuff %}
    <!-- crap -->
{% endmeasure %}

About


Languages

Language:Python 100.0%