Skip to main content

Django SQL Profiler

Project Description: Django SQL Profiler is a lightweight package inspired by the Sentry SDK. It allows you to effortlessly capture all SQL statements generated by your Django application and store them in MongoDB. To use this package, ensure that you have PyMongo installed.

How to Use:

  1. Installation:

    pip install django-sql-profiler
    
  2. Initialization: Import the sql_profiler module and call the install_sql_hook function with the desired configuration options. Example:

    from django_sql_profiler import install_sql_hook
    
    sql_profiler.install_sql_hook(
        {
            'slow_queries_threshold': 0.2,
            'app_namespace': ['apps.'],
            'mongodb': {
                'uri': MONGODB,
                'db': MONGODB_DB,
                'collection': 'sql_slow_queries'
            }
        }
    )
    
  3. Configuration Options:

    • slow_queries_threshold (float): Set the threshold for slow queries in seconds.

    • app_namespace (list): Specify the namespaces of your Django apps to filter SQL statements.

    • mongodb (dict): Configure MongoDB connection details.

      • uri (str): MongoDB connection URI.
      • db (str): MongoDB database name.
      • collection (str): MongoDB collection to store SQL slow queries.
  4. Note: Ensure that PyMongo is installed in your environment before using this package.

Release files for django-sql-profiler 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sql-profiler 0.0.15
File Size Uploaded
django_sql_profiler-0.0.15.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-sql-profiler 0.0.15
File Interpreter ABI Platform
django_sql_profiler-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / django_sql_profiler-0.0.15.tar.gz

Download URL django_sql_profiler-0.0.15.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2f82ae1ca5e84f5731be08135414e988c74c0ff3fc4b66d7539dea85917cb868
BLAKE2b-256 checksum
How to use checksums
30d1ab56d1858ca81848f9fc3e31ba419ec428fe2e60d3db90ce8c49f6fc5ee2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.17

Release files / django_sql_profiler-0.0.15-py3-none-any.whl

Download URL django_sql_profiler-0.0.15-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c1999763551a43913d339e3dc0548fb312b909c325abf6737754097dceb2639
BLAKE2b-256 checksum
How to use checksums
255633c74eed8e62087cf45f662375908e103531624fb41819818a06231ed1e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.17

Release history Release notifications | RSS feed

This release

0.0.15 This release

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page