-
Notifications
You must be signed in to change notification settings - Fork 53
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
GO-2828: add debug diagnostics for spaces and connections #314
base: main
Are you sure you want to change the base?
GO-2828: add debug diagnostics for spaces and connections #314
Conversation
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
Coverage provided by https://github.com/seriousben/go-patch-cover-action |
…debug-diagnostics-for-spaces-and-connections
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
net/pool/pool_test.go
Outdated
@@ -240,16 +357,31 @@ func (d *dialerMock) Name() (name string) { | |||
return "net.peerservice" | |||
} | |||
|
|||
func newTestPeer(id string) *testPeer { | |||
func newTestPeer(id string, created time.Time, subConnections int, version uint32) *testPeer { |
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.
make another constructor for testPeer with all that stuff, don't change other tests
return &Stat{ | ||
PeerId: p.id, | ||
SubConnections: subConnectionsCount, | ||
Created: p.created, |
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.
add a field called AliveTimeSecs
which will tell how many seconds it is alive
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.
Just write pls p.Lock(), defer p.Unlock() and then return &Stat{...}
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.
How do you propose to calculate AliveTimeSecs
, because don't see such field in peer? 🧐
…debug-diagnostics-for-spaces-and-connections
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
https://linear.app/anytype/issue/GO-2828/add-debug-diagnostics-for-spaces-and-connections