Giter Site home page Giter Site logo

char0n / django-profiler Goto Github PK

View Code? Open in Web Editor NEW
58.0 4.0 12.0 42 KB

django-profiler is util for profiling python code mainly in django projects but can be used also on ordinary python code. It counts sql queries a measures time of code execution. It logs its output via standard python logging library and uses logger profiling. If your profiler name doesn't contain any empty spaces e.g. Profiler('Profiler1') django-profiler will log all the output to the profiling.Profiler logger.

License: Other

Python 100.00%

django-profiler's Issues

Support for query lists

As Profiler context manager gets executed, it can measure number of executed queries. API user should also be able to get list of all SQL queries, that have been executed with manager.

e.g.

with Profiler('sql_profiler') as profiler:
Model.objects.filter(has_attribute=True)
print p.sql_list

Time, Query expectations

It would be nice to define on profiler level assertions/expections and make profiler report all not satisfied assertions/expectations.

Django configuration error while installing library from pip

While installing django-profiler into environment with django installed, django.core.exceptions.ImproperlyConfigured exception is raised. This is caused by the fact that profiler detects that django is installed and tries to import it. But import fails, because profiler tries to use django unconfigured.

Substitute profilehook with profile python module

Python 2.7 now contains profile module with virtually the same functionality as profilehook package which uses python-profiles debian package that have installation problems on new ubuntu/xubuntu installations.

Find out if it is even substitutable and if so, substitute it.

Incorrect io import

File "/Users/Shared/workspace/VOSM/CL_StoreMaps/venv/lib/python3.7/site-packages/profiling/init.py", line 9, in
from StringIO import StringIO
ModuleNotFoundError: No module named 'StringIO'

It was wrongly imported
fromStringIO import StringIO.

Please correct this line in _init.py , line 9 to
from io import StringIO

timeit module

Use timeit module for making time measurements instead of using time module

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.