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

GO-2828: add debug diagnostics for spaces and connections #314

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
Copy link

github-actions bot commented Oct 10, 2024

New Coverage 63.0% of statements
Patch Coverage 72.0% of changed statements (18/25)

Coverage provided by https://github.com/seriousben/go-patch-cover-action

…debug-diagnostics-for-spaces-and-connections
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
@@ -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 {
Copy link
Contributor

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

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

Copy link
Contributor

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{...}

Copy link
Member Author

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