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

Repair metrics #4511

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Repair metrics #4511

wants to merge 4 commits into from

Conversation

bw-solana
Copy link

@bw-solana bw-solana commented Jan 17, 2025

Problem

fn RepairService::run is giant and unwieldy. Shrinking this down a bit would help with parsing more quickly.
There are also multiple metrics structs intertwined together, and some missing timing metrics.

Trying to unspaghettify™️ part of this code

Summary of Changes

  • Make RepairMetrics struct to wrap existing metrics
  • Abstract out metrics reporting and pull them into metrics modules
  • Add timing metrics for sections we are missing (pruning outstanding requests, handling popular pruned forks)

("get-votes-elapsed", self.get_votes_elapsed, i64),
("add-votes-elapsed", self.add_votes_elapsed, i64),
(
"purge-outstanding-repairs",
Copy link
Author

Choose a reason for hiding this comment

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

this is 1 of 2 new metrics added. Everything else should just be cosmetic change

i64
),
(
"handle-popular-pruned-forks",
Copy link
Author

Choose a reason for hiding this comment

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

this is the 2nd metric changed


impl RepairMetrics {
pub fn maybe_report(&mut self) {
if self.last_report.elapsed().as_secs() > 2 {
Copy link
Author

Choose a reason for hiding this comment

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

I don't like this style since it's easy to think we report every 2 seconds but it's actually 3... but decided to not change it with this PR

@bw-solana bw-solana marked this pull request as ready for review January 17, 2025 18:05
@bw-solana bw-solana requested a review from alessandrod January 17, 2025 18:05
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.

1 participant