Skip to content
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

Add support for running profiling when debug build-tags provided #491

Merged

Conversation

NyaaaWhatsUpDoc
Copy link
Member

wrap root HTTP handler in debug.WithPprof(), rearrange router.Start() to support this

… to support this

Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
@NyaaaWhatsUpDoc
Copy link
Member Author

NyaaaWhatsUpDoc commented Apr 25, 2022

If you run script/build.sh with DEBUG=1 or any non-empty value then it will compile gotosocial with an extra build-tag debugenv.

What this will mean is that if you run gotosocial with the environment variable DEBUG=1 or again, any non-empty value, profiling will be active and available under "/debug/pprof". Obviously a security risk which it's behind 2 separate steps to enable it 😁

Signed-off-by: kim <grufwub@gmail.com>
… debug

Signed-off-by: kim <grufwub@gmail.com>
Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

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

Looks good to me! Don't forget to add your library dependencies to the README.md if you want to :) If you'd rather not, then go ahead and merge

@NyaaaWhatsUpDoc
Copy link
Member Author

Looks good to me! Don't forget to add your library dependencies to the README.md if you want to :) If you'd rather not, then go ahead and merge

ah yes i shall do! is it alright if i just use this PR to add all the libraries of mine that are missing?

Signed-off-by: kim <grufwub@gmail.com>
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 69011d4 into superseriousbusiness:main Apr 28, 2022
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.

None yet

2 participants