-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Avoid repeat periodic stats printing when there is no change #10891
Conversation
Summary: When there is a column family that doesn't get any traffic, its stats are still dumped when options.options.stats_dump_period_sec triggers. This sometimes spam the information logs. With this change, we skip the printing if there is not change, until 8 periods. Test Plan: Manually test the behavior with hacked db_bench setups.
@siying has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
db/internal_stats.cc
Outdated
} | ||
if (no_cf_change_period_since_dump_++ > 0) { | ||
// Not ready to sync | ||
if (no_cf_change_period_since_dump_ == kMaxNoChangePeriodSinceDump) { | ||
// Next periodic, we need to dump stats even if there is no change. | ||
no_cf_change_period_since_dump_ = 0; | ||
} | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
} | |
if (no_cf_change_period_since_dump_++ > 0) { | |
// Not ready to sync | |
if (no_cf_change_period_since_dump_ == kMaxNoChangePeriodSinceDump) { | |
// Next periodic, we need to dump stats even if there is no change. | |
no_cf_change_period_since_dump_ = 0; | |
} | |
return true; | |
} | |
} else { | |
no_cf_change_period_since_dump_++; | |
} | |
if (!has_change && no_cf_change_period_since_dump_ < kMaxNoChangePeriodSinceDump) { | |
return true; | |
} |
@siying has updated the pull request. You must reimport the pull request before landing. |
@siying has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary:
When there is a column family that doesn't get any traffic, its stats are still dumped when options.options.stats_dump_period_sec triggers. This sometimes spam the information logs. With this change, we skip the printing if there is not change, until 8 periods.
Test Plan: Manually test the behavior with hacked db_bench setups.