All Projects → someshchaturvedi → customizable-django-profiler

someshchaturvedi / customizable-django-profiler

Licence: MIT license
Customizable cProfileMiddleware for Django

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to customizable-django-profiler

django-profile-middleware
An easy to use customizable django profiling middleware to profile and find bottlenecks in your code and custom middlewares
Stars: ✭ 36 (+28.57%)
Mutual labels:  profiler, cprofile
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (+2692.86%)
Mutual labels:  customizable
PaintLang
An open source, OOP language with editable syntax.
Stars: ✭ 13 (-53.57%)
Mutual labels:  customizable
FlameViewer
Tool for flamegraphs visualization
Stars: ✭ 76 (+171.43%)
Mutual labels:  profiler
sddm-chili
The hottest theme around for SDDM, the Simple Desktop Display Manager.
Stars: ✭ 67 (+139.29%)
Mutual labels:  customizable
pterobilling
An open-source Laravel 8 online store, client area, and billing software specially made for Pterodactyl panel
Stars: ✭ 258 (+821.43%)
Mutual labels:  customizable
tatooine
A pluggable, simple, and powerful web scraper.
Stars: ✭ 60 (+114.29%)
Mutual labels:  customizable
hubi
Humanitarian ubiquitous language helper
Stars: ✭ 17 (-39.29%)
Mutual labels:  configurable
fullcontrols
Reworked version of the wpf controls, plus new controls and features.
Stars: ✭ 28 (+0%)
Mutual labels:  customizable
rpatchur
A customizable, cross-platform patcher for Ragnarok Online clients.
Stars: ✭ 33 (+17.86%)
Mutual labels:  customizable
dev doctor
Free, opensource, serverless learning platform
Stars: ✭ 34 (+21.43%)
Mutual labels:  customizable
Punica-CSS-Framework
Punica CSS is a clean, lightweight, responsive, modern and fully customizable (even class names) pure CSS Framework based on SASS / SCSS with multi-theme support.
Stars: ✭ 35 (+25%)
Mutual labels:  customizable
bytehound
A memory profiler for Linux.
Stars: ✭ 2,639 (+9325%)
Mutual labels:  profiler
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (-25%)
Mutual labels:  customizable
django-speedinfo
Django views profiler for small projects
Stars: ✭ 55 (+96.43%)
Mutual labels:  profiler
GVProf
GVProf: A Value Profiler for GPU-based Clusters
Stars: ✭ 25 (-10.71%)
Mutual labels:  profiler
profiling
Non-discriminatory profiling of Ruby code leveraging the ruby-prof gem
Stars: ✭ 12 (-57.14%)
Mutual labels:  profiler
champ
A 65C02 profiler
Stars: ✭ 17 (-39.29%)
Mutual labels:  profiler
comet
A minimal and robust BEM-style CSS toolkit.
Stars: ✭ 18 (-35.71%)
Mutual labels:  customizable
NodeKit
surfstudio.github.io/nodekit
Stars: ✭ 27 (-3.57%)
Mutual labels:  customizable

Customizable Django Profiler

Django cProfile middleware having configurable triggers and outputs

Requirements

Django-1.10 or above (For below version 1.10 refer this package)

Getting Started

Follow given instructions to setup customizable-django-profiler

Install

Install via pip

$ pip install customizable-django-profiler

Add

Add customizable_django_profiler.cProfileMiddleware to the end of MIDDLEWARE in project's settings.py

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    ....
    'customizable_django_profiler.cProfileMiddleware',
]

Enable

Add PROFILER in project's settings.py and set activate = True.

PROFILER = {
    'activate': True,
}

Done! This will provide the profile data on the server console

Example

        622 function calls (579 primitive calls) in 0.001 seconds

   Ordered by: internal time
   List reduced from 207 to 100 due to restriction <100>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   ...      ...      ...       ...     ...           ...
   ...      ...      ...       ...     ...           ...

Customize

You can customize the Profiler settings via adding some varaibles in Profiler key in settings.py

Default are

PROFILER = {
    'activate': True,
    'sort': 'time',
    'count': '100' ,
    'output': ['console'],             
    'file_location': 'profile.txt',
    'trigger': 'all'
}

Description of cutomizable keys

activate

Set this key to True to enable Profiler

'activate': True

To disable set to False

'activate': False

sort

Sort according to the set value. Default is 'time'. See documentaion for more options

count

Specify number of rows to output. Default is 100.

output

Specify the form of output. Multiple output formats can be selected. Default is ['console']. Options are 'file', dump and 'response'.
'file' and dump will write the file specified by 'file_location' key and 'response' will output the result as response of request.
file is used for a txt file.
dump will be used for binary dump.
Some examples are

'output': ['console']
'output': ['console', 'file', 'response']
'output': ['file', 'response']

file_location

Specify the location of file you want to write in the results. Only valid if 'file' in 'output' key. Default value profile.txt

trigger

Specify the trigger for API on which profiler runs. Default is 'all'. Instead you can trigger profiler by passing a query parameter, which can be specified after : in 'trigger' key for example

'trigger' : 'query_param:profile'

Profiling will only be enabled for APIs with profile in their request parameters.

http://localhost:8000/api/?profile

Author

Contibutors

License

This project is licensed under the MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].