django-httpbench
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
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 ).
Metadata
Release files for djangohttpbench 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djangohttpbench-0.1.0.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djangohttpbench-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / djangohttpbench-0.1.0.tar.gz
| Download URL | djangohttpbench-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18984b513508d9a757ebf49b1d3333f4498192cebd024d1e0884509e4572597e
|
|
BLAKE2b-256 checksum How to use checksums |
72cb3f2bf12075b1c7903e8ab3908f7acc8e859af7e9e555e45f4c8adfdc8a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / djangohttpbench-0.1.0-py3-none-any.whl
| Download URL | djangohttpbench-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6c42e08527eaa1347757e8423f550854b02ebed085915be9d5f705256702ea0
|
|
BLAKE2b-256 checksum How to use checksums |
c136455f6d8722ee49d45f810474d9b6179333e2220242f7e9470292caaa0e37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|