-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve the utility of the swarm stats command for determining which limits are being hit #9474
Comments
Per 2022-12-07 maintainer conversation: the top ask of "When --min-used-limit-perc is used, only include the specific limits that exceed min-used-limit-perc rather than the whole scope" will require more work because of the structs we're relying on from go-libp2p. |
We cannot output specific fields on the limit struct because we are not using pointers. We can fill the limits that are above the threshold, but all other fields will appear as zeroes. Example:
I think that can be misleading to the user. To be able to just output the specific field ("Conns" in this case) we need to copy all the libp2p Limit structs and use pointers on fields instead.
Go JSON library is ordering fields in lexicographic order. If we want to change that we should do some research about other libraries that allow changing the ordering or see if there is any way to specify an order when encoding using the standard library.
The same as the previous point, fields are ordered in lexicographic order. |
Thanks for the info @ajnavarro . Some thoughts...
Are we sure there isn't a way to either:
would be great.
rather than constructing one big struct that we print, can we do multiple print statements, one for each of these:
Again, I think it's fine if this isn't directly copy/pastable. Clarity of information for debugging is more important.
I'm ok to give up on this one, but if copying "BaseLimit" struct gets us there, than I'm interested in it. |
AFAIU, output from |
@ajnavarro : the intent/desire to have the commands compatible with the actual configuration makes sense. That said, as I think we have found while working with users to debug their issues in #9432 that the commands in their current output form aren't as useful as they could be as they aren't highlighting the key information and bringing it to the top. The resource manager is complex and information overload or disorganization doesn't help. As a result, I personally think it's more important to provide precise information than hold to the tenet of exporting "actual configuration". To help with this, maybe we add prefixing note to the output like:
I think the way forward here is either:
|
No more work on this specifically is planned given going to change/simplify the commands to focus on more useful debug information per #9621 |
Below are some ideas to improve the utility of
swarm stats
after having used it for debugging resource management limit concerns.I've listed these in priority order.
When
--min-used-limit-perc
is used, only include the specific limits that exceed min-used-limit-perc rather than the whole scopeLooking at my current limits:
When I do
ipfs swarm stats --min-used-limit-perc=10 system
, I would want to just see "ConnsInbound" since that is what is using more than 10%. Instead I see the whole scope:(Note there is a bug with
ipfs swarm stats --minu-sed-limit-perc
when the "all" scope is used: #9473 )List scopes from big picture downwards when "all" scope is used
The current dump of
swarm stats all
doesn't put the most important (big picture) stuff at the top:This is exasperated by how there is lots underneath peers.
The order that I think is more intuitive is:
With that I can do
ipfs swarm stats all
and read from top to bottom to get a sense of what's happening.(The same is true for
ipfs swarm limit all
)(Minor) List limits within a scope in importance order
When outputting a scope, we are listing chronologically:
I think it would be more useful to to put in an order like:
(The same is true for
ipfs swarm limit
)The text was updated successfully, but these errors were encountered: