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

feat: add a dht stat command #7221

Merged
merged 1 commit into from
May 15, 2020
Merged

feat: add a dht stat command #7221

merged 1 commit into from
May 15, 2020

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Apr 27, 2020

Currently, it just prints out the routing tables.

TODO

  • Tests It's a debugging command.
  • Maybe better output formatting?

@Stebalien Stebalien force-pushed the feat/dht-stat branch 3 times, most recently from 4eaa27f to dc16812 Compare April 27, 2020 06:19
core/commands/dht.go Outdated Show resolved Hide resolved
core/commands/dht.go Outdated Show resolved Hide resolved
core/commands/dht.go Outdated Show resolved Hide resolved
@willscott
Copy link
Contributor

It seems fine to have this as a DHT sub-command. I think the only question is if it's worth having a warning or otherwise making it clear that the format and underlying implementation-specific info that's showing up may change and this isn't a structure we're signing up to support long term.

@Stebalien Stebalien force-pushed the feat/dht-stat branch 2 times, most recently from 0c7bafa to cdf6f21 Compare May 15, 2020 02:12
@Stebalien
Copy link
Member Author

  1. I've added a comment explaining that this command is unstable.
  2. I've moved it to ipfs stats dht.

@Stebalien Stebalien requested a review from willscott May 15, 2020 02:13
// parts. That is, change "2m3.00010101s" to "2m3s ago".
now := time.Now()
since := func(t time.Time) string {
return string(decimalRegex.ReplaceAll(
Copy link
Contributor

Choose a reason for hiding this comment

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

locally, if i do
now.Sub(t).Round(time.Second).String() i don't see a decimal. When is this regex needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right... that's a lot simpler.

@Stebalien Stebalien force-pushed the feat/dht-stat branch 2 times, most recently from 7cffaed to 578d8b8 Compare May 15, 2020 06:26
Currently, it just prints out the routing tables.
@Stebalien Stebalien merged commit 043acbd into master May 15, 2020
@Stebalien Stebalien deleted the feat/dht-stat branch May 15, 2020 07:18
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
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