-
Notifications
You must be signed in to change notification settings - Fork 161
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
fix: move bitswap msg counters out of encode/decode #374
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what was wrong before?
The counters were in the encode/decode functions which skewed results as we encode a lot more than we actually send. |
But that is also valuable information... Anyway, looks good. |
@@ -287,6 +288,7 @@ impl<S: Store> Bitswap<S> { | |||
|
|||
fn receive_message(&self, peer: PeerId, message: BitswapMessage) { | |||
inc!(BitswapMetrics::MessagesReceived); | |||
record!(BitswapMetrics::MessageBytesIn, message.encoded_len() as u64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this encodes the message again :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik :( Want me to extend BitswapMessage with a pre calculated len?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could cache it?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get it in and worry about improving that encoding issue later
No description provided.