Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.