Performance: Health check endpoints
MEDIUM IMPACT
Health check endpoints affect server responsiveness and overall user experience by ensuring quick status reporting without blocking main application processes.
from flask import Flask app = Flask(__name__) @app.route('/health') def health_check(): # Simple quick check return {'status': 'ok'}
from flask import Flask app = Flask(__name__) @app.route('/health') def health_check(): # Simulate heavy database query result = complex_database_query() return {'status': 'ok', 'db': result}
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy database query in health check | 0 (API only) | 0 | 0 | [X] Bad |
| Simple static response in health check | 0 (API only) | 0 | 0 | [OK] Good |