Skip to main content

HTTP load testing tools for Django. Like an apache bench but requests are sent from authenticated users.

Project description

HTTP load testing tools for Django. Like an apache bench but requests are sent from authenticated users without having to know their password.

Installation

django-httpbench requires python 3.6 or later and Django 2.0 or later.

$ python3 -m pip install djangohttpbench

https://pypi.org/project/djangohttpbench/

Usage

HeaderAuthBackend

Django authentication backend that allows one to login without having to know their password. This backend is useful for testing scenarios.

HTTP_BENCH_USERNAME_KEY = "X-USERNAME"  # default: X-USERNAME

INSTALLED_APPS += [
    'httpbench.apps.HttpbenchConfig',
]

MIDDLEWARE += [
    'httpbench.middlewares.HeaderAuthMiddleware',
]

AUTHENTICATION_BACKENDS += [
    'httpbench.backends.UsernameBackend',
]
$ curl -H 'X-USERNAME: c-bata' https://localhost:8000/path/to/page/require/auth

httpbench management command

httpbench management command acts like an apache bench but requests are sent from authenticated users.

$ python3 manage.py httpbench -n 1000 -c 50 \
> --username c-bata \
> https://localhost:8000/
Response time:
  mean: 3.862 secs
  min: 1.173 secs
  max: 11.097 secs
Status:
  2xx: 1000
  3xx: 0
  4xx: 0
  5xx: 0
  fail: 0

Development

  • lint: tox -e flake8 or flake8

  • test: tox -e py37 or DJANGO_SETTINGS_MODULE=test_settings python -m django test

License

This software is licensed under the MIT License (See LICENSE ).

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

djangohttpbench-0.1.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

djangohttpbench-0.1.0-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

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