Skip to content

feat: add profiling middleware and update README for performance prof…#236

Merged
grillazz merged 3 commits intomainfrom
235-profiler
Feb 5, 2026
Merged

feat: add profiling middleware and update README for performance prof…#236
grillazz merged 3 commits intomainfrom
235-profiler

Conversation

@grillazz
Copy link
Owner

@grillazz grillazz commented Feb 5, 2026

…iling

@grillazz grillazz requested a review from Copilot February 5, 2026 10:47
@grillazz grillazz self-assigned this Feb 5, 2026
@grillazz grillazz linked an issue Feb 5, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.2 as a new dependency
  • Implemented ProfilingMiddleware to enable conditional profiling via ?pyprofile=true query parameter
  • Added --reload flag 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.

@grillazz grillazz merged commit ab887ad into main Feb 5, 2026
3 checks passed
@grillazz grillazz deleted the 235-profiler branch February 5, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

profiler

2 participants