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

shards: always aggregate stats for tracing #729

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

keegancsmith
Copy link
Member

Many a time I have seen a slow search without tracing turned on. I then go to visit the net/trace page to see what happened but it is missing the stats to try work out why.

This commit will ensure we always log the aggregated statistics. This should be cheap to do given Add is relatively fast and LazyPrintf will only do the stringer operation if someone loads the debug page. It does mean a Stats object lives a bit longer in memory, but it is small.

Test Plan: go test

Many a time I have seen a slow search without tracing turned on. I then
go to visit the net/trace page to see what happened but it is missing
the stats to try work out why.

This commit will ensure we always log the aggregated statistics. This
should be cheap to do given Add is relatively fast and LazyPrintf will
only do the stringer operation if someone loads the debug page. It does
mean a Stats object lives a bit longer in memory, but it is small.

Test Plan: go test
@keegancsmith keegancsmith merged commit b08be72 into main Jan 29, 2024
8 checks passed
@keegancsmith keegancsmith deleted the k/log-stats branch January 29, 2024 09: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.

2 participants