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

Only touch bytebufs when doing advanced logging #1354

Merged
merged 4 commits into from
Oct 21, 2022
Merged

Only touch bytebufs when doing advanced logging #1354

merged 4 commits into from
Oct 21, 2022

Conversation

artgon
Copy link
Contributor

@artgon artgon commented Oct 20, 2022

No description provided.

@artgon artgon requested a review from gavinbunney October 20, 2022 21:31
private static final boolean isAdvancedLeakDetection =
ResourceLeakDetector.getLevel() == PARANOID || ResourceLeakDetector.getLevel() == ADVANCED;

public static void touch(ReferenceCounted byteBuf, String hint, ZuulMessage msg) {
Copy link
Collaborator

@gavinbunney gavinbunney Oct 20, 2022

Choose a reason for hiding this comment

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

May be worthwhile using a String.format with hint, with vargs param instead of ZuulMessage param, to allow for future logging of other objects if required - would also mean could just have a single touch method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about that too, but String.format has terrible performance.

Co-authored-by: Gavin Bunney <409207+gavinbunney@users.noreply.github.com>
@artgon artgon merged commit 9de28bb into master Oct 21, 2022
@artgon artgon deleted the logging-perf branch October 21, 2022 02:44
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.

2 participants