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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file djangohttpbench-0.1.0.tar.gz.

File metadata

  • Download URL: djangohttpbench-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for djangohttpbench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18984b513508d9a757ebf49b1d3333f4498192cebd024d1e0884509e4572597e
MD5 be9e9649a2feaf5e16914c47fcceedf3
BLAKE2b-256 72cb3f2bf12075b1c7903e8ab3908f7acc8e859af7e9e555e45f4c8adfdc8a9f

See more details on using hashes here.

File details

Details for the file djangohttpbench-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: djangohttpbench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for djangohttpbench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c42e08527eaa1347757e8423f550854b02ebed085915be9d5f705256702ea0
MD5 af957ceeb9505d032d5ef69db4829416
BLAKE2b-256 c136455f6d8722ee49d45f810474d9b6179333e2220242f7e9470292caaa0e37

See more details on using hashes here.

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