Skip to main content

Khronos is a Python library that benchmarks the duration of Django tests. It helps identify slow-running tests in your test suite, allowing you to optimize their performance.

Project description

Khronos

Are your org hotfixes truly considered "hotfixes" if they take longer than 15 minutes to go live because of slow tests workflows running on GitHub Actions? To speed up this imagine benchmarking test durations to identify the slow tests when the total number of tests > 500, it seems impractical to run each test individually and manually record their duration times.

Khronos is a Python library that benchmarks the duration of Django tests. It helps identify slow-running tests in your test suite, allowing you to optimize their performance.

Feautres:

1) Benchmark Report: Create benchmark report in the terminal whenever you run your django tests and shows top 10(this no. can be configured) slowest tests.

2) Parallel Test Execution: Works with --parallel out of the box.

3) Google Sheets Integration: Whole tests benchmark can be automatically uploaded to Google Sheets.

4) CSV Export: Whole tests benchmark can be saved in a CSV.

How to configure:

  1. python -m build and install in your virtual env.
  2. Add TEST_RUNNER = "khronos.custom_test_runner.KhronosTestRunner" in your settings.py
  3. If you want to increase the number of slowest tests displayed on terminal then set KHRONOS_REPORT_MAX_ROW= in your settings.py.
  4. If you want to add Google Sheets integration, add: KHRONOS_SPRAEDSHEET_REPORT_GSHEET_ID = "your-google-sheet-id" and your KHRONOS_GSHEET_CREDS_FILE_PATH = "your-gsheet-cred-path" in your settings.py` .
  5. For saving the khronos benchmark report.

Tested on Django 3.2.14. Open an issue if it's not supported in your's django version

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

django-khronos-0.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

django_khronos-0.1.1-py3-none-any.whl (5.9 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