{"repo":"yeongbin05/django-xbench","free":true,"listed":false,"github":"https://github.com/yeongbin05/django-xbench","clone":"git clone https://github.com/yeongbin05/django-xbench.git","description":"Lightweight Django middleware for APM-style request profiling (DB vs App time, query count)","language":"Python","stars":31,"topics":["apm","developer-tools","django","middleware","observability","performance","profiling","server-timing"],"license":"MIT","category":"analytics","readme_excerpt":"django-xbench Lightweight Django middleware for APM-style request profiling Measure DB vs App time and query count with near-zero configuration. Why django-xbench? - 🔍 DevTools visibility : See DB vs app/serialization time in Chrome DevTools via Server-Timing . - 🚀 Zero-agent : No daemon, no SaaS — just one Django middleware. - 🧩 Drop-in : Near-zero configuration (add middleware and go). - 🔒 Privacy-first : Exposes timing + query counts only ( no query contents stored ). Goal: make performance bottlenecks “visible” (DB vs app/serialization) without heavyweight APM. Here's how django-xbench exposes request timing breakdown using the Server-Timing header: Adds Server-Timing and X-Bench-Queries headers and optionally logs per-request metrics. Features - ✅ Measures total request time and DB time (via connection.execute wrapper ) - ✅ Calculates app time (= total - db) - ✅ Counts DB queries - ✅ Adds response headers: - Server-Timing: xbench-total;dur=..., xbench-db;dur=..., xbench-app;dur=... - X-Bench-Queries: - ✅ Optional logging: - [XBENCH] GET /path xbench total=...ms xbench db=...ms xbench app=...ms q=... - ✅ Slow endpoint aggregation (in-memory, per process) + simple dashboard (experimental) - ✅ Tested with pytest + pytest-django Installation For local development (this repository): Quickstart 1) Add middleware in your settings.py : 2) Run your server and hit any endpoint: In your project: In this repo (demo): You should see headers similar to: Output Server-Timing Exampl","default_branch":null,"files":null,"tree":[],"storefront":"/r/yeongbin05","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/yeongbin05/django-xbench/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}