This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
return a ConnectionStat instead of a Stat for the Conn #224
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vyzo
approved these changes
Dec 10, 2021
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.
We probably should call it ConnStat
as we don't spell it fully anywhere; other than that LGTM.
@@ -96,7 +96,14 @@ func (r Reachability) String() string { | |||
return str[r] | |||
} | |||
|
|||
// Stat stores metadata pertaining to a given Stream/Conn. | |||
// ConnectionStat stores metadata pertaining to a given Conn. | |||
type ConnectionStat struct { |
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.
Let's call it ConnStat
for consistency?
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.
I'd love to, but ConnStat
is already the interface:
go-libp2p-core/network/conn.go
Lines 63 to 67 in 975f71b
// ConnStat is an interface mixin for connection types that provide connection statistics. | |
type ConnStat interface { | |
// Stat stores metadata pertaining to this conn. | |
Stat() Stat | |
} |
|
Ouch.... oh well.
…On Fri, Dec 10, 2021, 13:19 Marten Seemann ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In network/network.go
<#224 (comment)>:
> @@ -96,7 +96,14 @@ func (r Reachability) String() string {
return str[r]
}
-// Stat stores metadata pertaining to a given Stream/Conn.
+// ConnectionStat stores metadata pertaining to a given Conn.
+type ConnectionStat struct {
I'd love to, but ConnStat is already the interface:
https://github.com/libp2p/go-libp2p-core/blob/975f71b238330cbfafb4a96f674ff047686dc219/network/conn.go#L63-L67
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#224 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAI4SQ6LQQYKJC66UE7DL3UQHO5XANCNFSM5JY3KYXA>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows us to expose the number of streams that are currently open on a connection, which will allow us to prioritize killing of connections with many streams in the connection manager.