
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
DBTimer
is a Django management command designed to measure the performance of various database operations (read, write, search) across different models and databases in a Django application. It helps developers and database administrators benchmark and optimize query performance by recording execution times and generating visual graphs.
You can install the Django DBTimer Command
package via pip
:
pip install dbtimer
To use the Django DBTimer Command, you need to add some configuration to your Django settings:
Most commonly you will be creating a settings_local because this feature will likely not be used in production.
####Example:
DBTIMER_ARGS = {
"cycles": 100, # Number of iterations per operation
"sleep": 0.1, # Sleep interval between operations
"operations": ["read", "write", "search"], # Operations to benchmark
"models": [
{
"conf": ("myapp", "MyModel"),
"name": "MyModel",
"attr": "field_name",
"search": {"field_name__icontains": "test"},
},
# Add more models as needed
],
"dbs": ["default", "replica"], # Databases to test
}
AWS_S3_REGION_NAME = 'your-region' AWS_S3_ENDPOINT_URL = 'https://your-s3-endpoint' AWS_ACCESS_KEY_ID = 'your-access-key-id' AWS_SECRET_ACCESS_KEY = 'your-secret-access-key' LINODE_BUCKET = 'your-s3-bucket-name'
Run the management command with optional notes:
python manage.py dbtimer --notes "Testing query performance on different branches"
The command will produce:
After running the command, you will see logs indicating the progress and completion of the benchmarking process. The output files will be saved to your S3 bucket, and a URL will be provided in the console.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or feedback, please contact devs@djangowebstudio.com.
FAQs
A Django management command to measure and benchmark database query performance.
We found that dbtimer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.