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

counts received gossip packets inside the thread-pool #4445

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

behzadnouri
Copy link

Problem

We already traverse packets inside the thread-pool and know the variant, so might as well count packets there instead of a separate traversal.

Summary of Changes

The commit counts received gossip packets inside the thread-pool.

@behzadnouri behzadnouri force-pushed the count-gossip-packets-par branch 4 times, most recently from 6985f0e to 582d1b4 Compare January 14, 2025 15:27
We already traverse packets inside the thread-pool and know the variant,
so might as well count packets there instead of a separate traversal.
}
}
let mut counts = [0u64; 7];
let mut dropped_packets_counts = [0u64; 7];

Choose a reason for hiding this comment

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

It would be nice to make a struct for these. This is bound to explode at some point.

Copy link
Author

Choose a reason for hiding this comment

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

The struct is indeed self.stats; see record_dropped_packets.
But we need to map the enum identifier (u32) to the struct fields somewhere and that is what the combination of dopped_packet_counts and record_dropped_packets try to do.

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.

lgtm

@behzadnouri behzadnouri merged commit b2e14ef into anza-xyz:master Jan 15, 2025
47 checks passed
@behzadnouri behzadnouri deleted the count-gossip-packets-par branch January 15, 2025 16:01
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.

2 participants