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

Merged
merged 4 commits into from
Jan 22, 2025
Merged

Repair metrics #4511

merged 4 commits into from
Jan 22, 2025

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

Choose a reason for hiding this comment

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

can't wait till we can 🪓 this

Copy link
Author

Choose a reason for hiding this comment

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

spoilers


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
Copy link

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

Yes to depagettification!

@bw-solana
Copy link
Author

@alessandrod & @AshwinSekar - I'll give it another couple of days in case you want to review (or request more time). Else, I'll merge this in with Alex's approval

Copy link

@AshwinSekar AshwinSekar left a comment

Choose a reason for hiding this comment

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

LGTM

i64
),
(
"handle-popular-pruned-forks",

Choose a reason for hiding this comment

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

can't wait till we can 🪓 this

@bw-solana bw-solana merged commit 09840c1 into anza-xyz:master Jan 22, 2025
47 checks passed
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.

3 participants