-
Couldn't load subscription status.
- Fork 18
Feature/pprof middleware #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HeerakKashyap
wants to merge
15
commits into
goflash:main
Choose a base branch
from
HeerakKashyap:feature/pprof-middleware
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/pprof middleware #51
HeerakKashyap
wants to merge
15
commits into
goflash:main
from
HeerakKashyap:feature/pprof-middleware
Conversation
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
- Remove convenience_methods example (should be in separate repo) - Added tests for edge cases in convenience methods - Added tests for NoContent, Stream, StreamJSON edge cases - Added tests for Clone, Finish, SetRequest, SetResponseWriter methods - Added tests for Get with default values and Set method - Improve coverage from 95.3% to 95.8%
- Resolve merge conflicts with upstream/main - Remove duplicate BindJSON declarations (moved to bind.go) - Add missing strings import to test file - Keep convenience methods implementation - Maintain test coverage improvements
- Add Redirect, File, NotFound, InternalServerError convenience methods - Add BadRequest, Unauthorized, Forbidden, NoContent methods - Add Stream, StreamJSON methods - Add SetCookie, GetCookie, ClearCookie methods - Add missing io import for Stream method - Fix compilation errors in ratelimit_test.go
Co-authored-by: Copilot <[email protected]> Signed-off-by: Dmitri Meshin <[email protected]>
…akKashyap/flash into feature/convenience-methods
- Change from c.Forbidden() to c.Forbidden('file is a directory')
- Provide clear error message when attempting to serve a directory
- Maintain consistent error messaging across convenience methods
…akKashyap/flash into feature/convenience-methods
Co-authored-by: NewCapital.in <[email protected]> Signed-off-by: HootingConjuror <[email protected]>
Signed-off-by: HootingConjuror <[email protected]>
- Add Pprof middleware that mounts Go's built-in pprof handlers - Add MountPprof function for direct route mounting (more efficient) - Support configurable prefix (default: /debug/pprof) - Include comprehensive tests and examples - Add security considerations and usage documentation Closes goflash#38
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Hey @meshin-dev, do we need to pass the Codecov check? It’s only falling short by a small percentage |
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.
Add Pprof Middleware
Implements pprof middleware for runtime profiling as requested in #38.
What it does
Mounts Go's built-in pprof handlers under
/debug/pprof(or custom prefix) so you can profile your app.Usage
Available endpoints
/debug/pprof/- Index page/debug/pprof/profile- CPU profile/debug/pprof/heap- Heap profile/debug/pprof/goroutine- Goroutine profileSecurity
Only enable in development. Consider adding auth for production use.
Closes #38