Skip to main content

Context manager to upload explain plans to https://explain.dalibo.com/

Project description

DJDT-PEV2 (Django Debug Toolbar - Postgres explain visualizer 2)

PyPI version versions Lint

This tool captures sql queries within the context and provides an easy interface to generate and utilize a postgresql explain visualizer (PEV) by dalibo.

Usage

import django_pev

with django_pev.explain(
    # By default the text of the query is not uploaded for security reasons
    upload_query=True,
    title="Analyzing slow User join"
) as e:
    # Every SQL query is captured
    list(User.objects.filter(some__long__join=1).all())

# Rerun the slowest query with `EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)`
# And upload the results to https://explain.dalibo.com
pev_response = e.slowest.visualize()
print(pev_response.url)


# Delete the plan hosted on https://explain.dalibo.com
pev_response.delete()

Disclaimer

Credit goes to Pierre Giraud (@pgiraud) for PEV2 and Alex Tatiyants (@AlexTatiyants) for the original pev tool.

IN NO EVENT SHALL DALIBO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DALIBO HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DALIBO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND DALIBO HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_pev-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

django_pev-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file django_pev-0.1.0.tar.gz.

File metadata

  • Download URL: django_pev-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.2 Darwin/21.3.0

File hashes

Hashes for django_pev-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83db749ff46576c37390a999b5d1c9d8ad9b50214173b7dd4ce6edd2647f705d
MD5 6bd65d9174c5748999b01edcb49e648f
BLAKE2b-256 add17c30640a5f00af8386a20d5bb63f30a66b271b8e639e6729f7685e5f6285

See more details on using hashes here.

File details

Details for the file django_pev-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_pev-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.2 Darwin/21.3.0

File hashes

Hashes for django_pev-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea24c4d6b2adc8eb8c23804db2ce547367430d6d51b14292f37326b1a2d7ceee
MD5 2c092a2b4ad8df1fe1c261111d636cd5
BLAKE2b-256 9899d273b5898f865b3b245b8b969b700232c03740a7e9c124b78a3c7fd3ecd7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page