mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 00:19:51 +03:00
This commit adds a new `slow_query_logger` function in `core/utils.py` that wraps Django database executions and logs queries taking longer than 100ms. It uses `time.monotonic()` for robust timing. The logger is globally registered in `core/apps.py` via the `connection_created` signal with `weak=False` to ensure all new database connections are properly instrumented. Unit tests have been added to `core/tests/test_slow_query.py` and the development plan checkbox is updated. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>