Skip to main content

django-processinfo is a Django application to collect information about the running server processes.

Project description

django-processinfo is a reuseable Django application for collecing information about the running server processes. We try to cause as little additional overhead: django-processinfo creates most of the time only one database query to update the data.

The most important data that django-processinfo will be captured:

  • Process statistics:

    • process PID, start time, life times

    • Number of average/max living processes

    • min/average/max response times

    • Total request/exceptions count

  • Memory statistics:

    • min/average/max memory usage (VmRSS, VmPeak)

  • System informations:

    • System memory usage

    • Swap usage

    • load average

django-processinfo splits some of these data per SITE_ID, so you can see e.g. which site is mostly used.

What is it not:

more info: http://www.python-forum.de/viewtopic.php?f=6&t=27168 (de)

limitation

This only works, if /proc/$$/status exists. So only on unix/linux like platforms, yet.

TODO

Add unittests

screenshots

Here some screenshots (from v0.2 - 19.08.2011) how it looks like:


Screenshot 1


Screenshot 2

install

  1. install it e.g.:

pip install django-processinfo
  1. add settings (see below)

  2. create tables (run syncdb)

settings

add this to your settings.py:

import os

import django_processinfo


INSTALLED_APPS = (
    ...
    'django_processinfo',
    ...
)

MIDDLEWARE_CLASSES = (
    'django_processinfo.middlewares.django_processinfo.ProcessInfoMiddleware',
    ...
)

# Put templates above admin contrib, e.g.:
TEMPLATE_DIRS = (
    ...
    os.path.join(os.path.abspath(os.path.dirname(django_processinfo.__file__)), "templates/"),
    ...
)

# include app settings from ./django_processinfo/app_settings.py
from django_processinfo import app_settings as PROCESSINFO

# Change settings like this:
PROCESSINFO.ADD_INFO = True

ProcessInfoMiddleware

The ProcessInfoMiddleware can actually be inserted anywhere. However, it should be added far above. Thus, to capture everything.

For performance enhancement, you can put ProcessInfoMiddleware after LocalSyncCacheMiddleware. But then, however, lacks statistical values on every cache hit!

app settings

Available django-processinfo settings can you found in ./django_processinfo/app_settings.py

Django compatibility

Version

Tested with:

v0.8.0

django v1.6

v0.7.0

django v1.5

v0.6.1

django v1.4

history

  • v0.8.0.dev - 02.2014

    • Start testing with django 1.6

  • v0.7.0 - 12.02.2014

    • Changes for django 1.5 support

    • change setup install_requires to Django v1.3.x - v1.5.x

  • v0.6.4 - 21.09.2012

    • Bugfix in templates: missed i18n

  • v0.6.3 - 24.08.2012

    • remove auto commit date from version

  • v0.6.2

    • Auto cleanup ProcessInfo table to protect against overloading.

    • Don’t insert django-processinfo “time cost” info if response.status_code is not 200

  • v0.6.1

    • Tested also with django v1.4

    • change setup install_requires to Django v1.3.x - v1.4.x

  • v0.6.0

    • Add “Reset all data” in object tools.

    • Make “Remove dead PIDs” and “Reset all data” available on both admin pages.

  • v0.5.2

  • v0.5.1

    • Add “Remove dead PIDs” as admin view in “Process statistics” object tools (top, right, grey links)

  • v0.5.0

    • Model changes: Please recreate tables, e.g.: ./manage.py reset django_processinfo

    • New: Display some static system informations (uname, domain name, ip adress, python version, sys.prefix)

    • New: current living processes (also per site)

    • display sum of user/system mode time

  • v0.4.1

  • v0.4

    • Bugfix with “Total created processes”

    • Display “Process lifetime”

  • v0.3.0

    • Display some system information from /proc/meminfo and ‘load average’

    • Many Bugfixes

  • v0.2.0

    • Many things changes! Recreate tables, e.g: ./manage.py reset django_processinfo

  • v0.1.0

    • first Version

donation

If you like it, send some Bitcoins to 1J2gfYNSjpB9P7EkpTVWUY3rWQCpbfjEhX ;)

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-processinfo-0.7.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distributions

django_processinfo-0.7.1-py2.7.egg (20.7 kB view details)

Uploaded Source

django_processinfo-0.7.1-py2-none-any.whl (24.7 kB view details)

Uploaded Python 2

File details

Details for the file django-processinfo-0.7.1.tar.gz.

File metadata

File hashes

Hashes for django-processinfo-0.7.1.tar.gz
Algorithm Hash digest
SHA256 0e2faa2ff842c6a603e78dc4894d5daf71ce2f982c91f2b0eb2d88dac8884f80
MD5 89bb418e16a9f6689f8d07bbe768be5c
BLAKE2b-256 93edeb83398cd22ede6484d0d56f1e6415ce7082c0a40d19732cc436821eaa3f

See more details on using hashes here.

Provenance

File details

Details for the file django_processinfo-0.7.1-py2.7.egg.

File metadata

File hashes

Hashes for django_processinfo-0.7.1-py2.7.egg
Algorithm Hash digest
SHA256 c5340d0176947ee94a0fcf5d6dfecd978a2335f309c3226e4c878901657f7454
MD5 47bb47dcca9c7c20a4e5dc5693550aef
BLAKE2b-256 636d04aeb4acb44df2ff049b59b3932167e2d412c53b7b81a12d5ee465137e4c

See more details on using hashes here.

Provenance

File details

Details for the file django_processinfo-0.7.1-py2-none-any.whl.

File metadata

File hashes

Hashes for django_processinfo-0.7.1-py2-none-any.whl
Algorithm Hash digest
SHA256 fc8308682f5d856fb32c3b229b241126103ffc3711a859aa91d8f66812b5e634
MD5 38d9d6035fac4ec4a2c52cb3062b3365
BLAKE2b-256 e27cd73922644704164d90698e2ea25c1c71ac07a56c9d04808cec7e5fc1baf4

See more details on using hashes here.

Provenance

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