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

Consolidate stats recording in error handler #11992

Closed

Conversation

jowlyzhang
Copy link
Contributor

This is a non functional refactor, mostly for deduplicating the stats recording logic in error handler. Plus some documentation update and simple code dedupe.

Test Plan:
existing tests

} else {
if (bg_error_stats_ != nullptr) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to me if this stats recording happens, below block in HandleKnownErrors will happen too:

  if (bg_error_stats_ != nullptr) {
    RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT);
    RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED);
  }

And since this is the only caller of HandleKnownErrors, I removed its stats recording, and combined it into this block. This resulted in the common stats recording block at the beginning of this function. Let me know if this doesn't look alright.

@jowlyzhang jowlyzhang force-pushed the remove_force_enable_file_deletion branch from 223aadb to e711fd1 Compare October 20, 2023 22:43
@hx235 hx235 requested review from hx235 and removed request for hx235 December 29, 2023 22:44
Copy link
Contributor

@hx235 hx235 left a comment

Choose a reason for hiding this comment

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

LGMT - thanks for the clean up

Copy link
Contributor

@anand1976 anand1976 left a comment

Choose a reason for hiding this comment

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

LGTM

@jowlyzhang jowlyzhang force-pushed the remove_force_enable_file_deletion branch from e711fd1 to 79ac739 Compare January 22, 2024 18:42
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@jowlyzhang merged this pull request in ef34224.

@jowlyzhang jowlyzhang deleted the remove_force_enable_file_deletion branch January 22, 2024 23:31
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

4 participants