Skip to main content
https://badge.fury.io/py/django-rq-pulse.svg https://travis-ci.org/NZME/django-rq-pulse.svg?branch=master

A Django package to check that rq workers are running and notify admins if they are not

Quickstart

Install Django RQ Pulse:

pip install django-rq-pulse

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_rq_pulse.apps.DjangoRqPulseConfig',
    ...
)

Define the SERVER_EMAIL and ADMINS Django settings because these settings will be used to send notification emails.

Define a dictionary in your Django settings for your Redis connection details like so:

REDIS_DB = {
    'host': 'Your Redis Hostname or IP goes here',
    'port': 'Your Redis port number goes here',
    'database': 'Your Redis database number goes here'
}

Usage

Check that rqworkers are running:

$ python manage.py rq_pulse_check

If the actual number of workers is less the expected number of workers or If there are items in the queue but the queue size is not changing notify admins by email.

The above command will run with default parameters where:

--expected-num-workers=2
--seconds-to-sleep=5
--num-retries=5
--queue-name="default"

You can override these values by passing any or all the parameters to the command like so:

$ python manage.py rq_pulse_check --expected-num-workers=3 --queue-name="high"

To get a list of the command parameters use the –help parameter:

$ python manage.py rq_pulse_check --help

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.2.0 (2019-07-23)

  • Change behaviour of –expected-num-workers to only report to admins when the number of workers are less than the expected value. Add test versions for Python 3.6 and Django 2.2.

0.1.4 (2018-02-13)

  • Use the built in mail_admins Django function instead of send_mail.

0.1.3 (2018-02-12)

  • Add commands to Makefile to simplify the package build and release process.

0.1.2 (2018-02-12)

  • Modify setup.py to enable the usage of bumpversion.

0.1.1 (2018-02-12)

  • Allow the Redis connection details to be customizable.

0.1.0 (2018-01-19)

  • First release on PyPI.

Metadata

Release files for django-rq-pulse 0.2.0

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-rq-pulse 0.2.0
File Size Uploaded
django-rq-pulse-0.2.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-rq-pulse 0.2.0
File Interpreter ABI Platform
django_rq_pulse-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 13.8 kB

Release files / django-rq-pulse-0.2.0.tar.gz

Download URL django-rq-pulse-0.2.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1969fcec69b9a782f8976a5aca860c15334e974528c6661ecfc48968b233db21
BLAKE2b-256 checksum
How to use checksums
cb66af5413df56f8e75600efcc87c27aaa1c75e392c19536dd9cf2902e1cbd06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

Release files / django_rq_pulse-0.2.0-py2.py3-none-any.whl

Download URL django_rq_pulse-0.2.0-py2.py3-none-any.whl
Size 6.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
620fd278aec349369c2944118bc2c387e27adbd38eae980140882917256b43b7
BLAKE2b-256 checksum
How to use checksums
065444feb5ac7aaaad9837b88dc751e0a5d2d12743aa004df2be2b92c368b5cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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