Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Feature Request - query internal data #125

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kumavis
Copy link
Contributor

@kumavis kumavis commented May 19, 2019

This is not intended to be merged, just showing off some experimentation that required a fork

This is a quick hack for getting some internal info from the queries. I used this to start building some graphs that show off the query flow.

image
image (1)

pink - query initiator
orange - query initial peer
yellow - introduced
green - provider
blue - uninvolved
black - uninvolved and not connected to telemetry

note: for layout-circle the positions are random, not based on peerId, though I should do that next

a link means someone suggested someone as a closer peer or provider, or connects query initiator to initial peers
changing circle-layout to position by peerId will give an interesting look at how querys hone in on a result

It would be nice if possible to gather this info generically at the query layer, but here I put some extra info in the queryFn. When doing it all in the queryFn, the only thing missing was the initialPeers for the path. Though, in the end, I didn't need anything in the graph that was specific to a Path, but it could be helpful debugging and testing queries in the future.

@jacobheun
Copy link
Contributor

@dirkmc put together a visualizer not too long ago as well, https://github.com/dirkmc/js-libp2p-kad-dht-viz.

Being able to see what's going on in the DHT is a huge help for diagnosing issues. It would be great to have some mechansim of tracking the queries built in, even if it needed to be enabled via config (in case it adds non trivial overhead).

It would be great to see what we can take from these two implementations to accomplish this so that metrics are easily consumable by visualizers.

@vasco-santos did the introspection discussions for the libp2p visualization bring up the DHT at all?

@vasco-santos
Copy link
Member

Nice experiments @kumavis

@jacobheun yes it did and it will be part of the first screens to be worked on 🚀

@vasco-santos
Copy link
Member

FYI we are working on libp2p/go-libp2p#947. Once we support it in js, we should be able to provide this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants