django-postgres-metrics
Project description
=======================
A Django application that exposes a bunch of PostgreSQL database metrics.
Background
----------
At `PyCon Canada 2017 <https://2017.pycon.ca/>`_ `Craig Kerstiens
<http://www.craigkerstiens.com/>`_ gave a talk "`Postgres at any scale
<https://2017.pycon.ca/schedule/56/>`_". In his talk Craig pointed out a bunch
of metrics one should look at to understand why a PostgreSQL database could be
"slow" or not perform as expected.
This project adds a Django Admin view exposing these metrics to Django users
with the ``is_superusers`` flag turned on.
Installation
------------
Start by installing ``django-postgres-metrics`` from PyPI::
$ pip install django-postgres-metrics
Then you need to add ``postgres_metrics`` to your ``INSTALLED_APPS`` list. Due
to the wait postgres_metrics works, you need to include it *before* the
``admin`` app::
INSTALLED_APPS = [
'postgres_metrics.apps.PostgresMetrics',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
Lastly, you need to add a URL path to your global ``urls.py`` *before* the
``admin`` URL patterns.
For Django 2.0 and up::
from django.urls import include, path
urlpatterns = [
path('admin/postgres-metrics/', include('postgres_metrics.urls')),
path('admin/', admin.site.urls),
]
For Django 1.11 and before::
from django.conf.urls import include, url
urlpatterns = [
url(r'^admin/postgres-metrics/', include('postgres_metrics.urls')),
url(r'^admin/', admin.site.urls),
]
Security
--------
If you found or if you think you found a security issue please get in touch via
``info+django-postgres-stats *AT* markusholtermann *DOT* eu``.
I'm working about this in my free time. I don't have time to monitor the email
24/7. But you should normally receive a response within a week. If I haven't
got back to you within 2 weeks, please reach out again.
TESTING
-------
To run the unit tests::
$ pip install tox
$ tox
Home-page: https://github.com/django-postgres-metrics/django-postgres-metrics
Author: Markus Holtermann
Author-email: info+django-postgres-stats@markusholtermann.eu
License: BSD
Description-Content-Type: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
A Django application that exposes a bunch of PostgreSQL database metrics.
Background
----------
At `PyCon Canada 2017 <https://2017.pycon.ca/>`_ `Craig Kerstiens
<http://www.craigkerstiens.com/>`_ gave a talk "`Postgres at any scale
<https://2017.pycon.ca/schedule/56/>`_". In his talk Craig pointed out a bunch
of metrics one should look at to understand why a PostgreSQL database could be
"slow" or not perform as expected.
This project adds a Django Admin view exposing these metrics to Django users
with the ``is_superusers`` flag turned on.
Installation
------------
Start by installing ``django-postgres-metrics`` from PyPI::
$ pip install django-postgres-metrics
Then you need to add ``postgres_metrics`` to your ``INSTALLED_APPS`` list. Due
to the wait postgres_metrics works, you need to include it *before* the
``admin`` app::
INSTALLED_APPS = [
'postgres_metrics.apps.PostgresMetrics',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
Lastly, you need to add a URL path to your global ``urls.py`` *before* the
``admin`` URL patterns.
For Django 2.0 and up::
from django.urls import include, path
urlpatterns = [
path('admin/postgres-metrics/', include('postgres_metrics.urls')),
path('admin/', admin.site.urls),
]
For Django 1.11 and before::
from django.conf.urls import include, url
urlpatterns = [
url(r'^admin/postgres-metrics/', include('postgres_metrics.urls')),
url(r'^admin/', admin.site.urls),
]
Security
--------
If you found or if you think you found a security issue please get in touch via
``info+django-postgres-stats *AT* markusholtermann *DOT* eu``.
I'm working about this in my free time. I don't have time to monitor the email
24/7. But you should normally receive a response within a week. If I haven't
got back to you within 2 weeks, please reach out again.
TESTING
-------
To run the unit tests::
$ pip install tox
$ tox
Home-page: https://github.com/django-postgres-metrics/django-postgres-metrics
Author: Markus Holtermann
Author-email: info+django-postgres-stats@markusholtermann.eu
License: BSD
Description-Content-Type: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-postgres-metrics-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3918a814a9a0f80ade0b7dbac186e3ebdb2fd43302a9d3cafc40d1780c08e06 |
|
MD5 | 9bde2c3492a1fb43ccce459803f0171b |
|
BLAKE2b-256 | e15f0accff87d1b6120a02af544847e5b69ec0f426b35577c2b85e4b283227cb |
Close
Hashes for django_postgres_metrics-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c1d7750cdb0a816e6f738034a7645d071e8ddcb165fc7ad1da53f9c3c07f55 |
|
MD5 | 6d9652873b5aabe58b720681d5245296 |
|
BLAKE2b-256 | 620a9cc3a2859f712589c9671a5b01df7c7cb6dac9bc3e9a8ba7ffb5f5f41597 |