feat: add profiling middleware and update README for performance prof…#236
Merged
feat: add profiling middleware and update README for performance prof…#236
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds performance profiling capabilities to the FastAPI application using the pyinstrument library. The profiling can be enabled on-demand via a query parameter, allowing developers to analyze request performance and identify bottlenecks.
Changes:
- Added
pyinstrument>=5.1.2as a new dependency - Implemented
ProfilingMiddlewareto enable conditional profiling via?pyprofile=truequery parameter - Added
--reloadflag to the development Docker Compose configuration - Updated README with profiling documentation and usage examples
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Added pyinstrument 5.1.2 package with platform-specific wheels |
| pyproject.toml | Added pyinstrument>=5.1.2 to project dependencies |
| compose.yml | Added --reload flag to uvicorn for hot-reloading during development |
| app/middleware/profiler.py | New middleware implementation for conditional profiling via query parameter |
| app/main.py | Registered ProfilingMiddleware and GZipMiddleware in the FastAPI app |
| app/api/health.py | Added pyprofile parameter to redis_check endpoint for API documentation |
| README.md | Added performance profiling section with usage instructions and examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
83f518b to
447e4e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…iling