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

Avoid repeat periodic stats printing when there is no change #10891

Closed
wants to merge 2 commits into from

Conversation

siying
Copy link
Contributor

@siying siying commented Oct 27, 2022

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.

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.
@facebook-github-bot
Copy link
Contributor

@siying has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@jay-zhuang jay-zhuang left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 1070 to 1078
}
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;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
}
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;
}

@facebook-github-bot
Copy link
Contributor

@siying has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@siying has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants