-
Notifications
You must be signed in to change notification settings - Fork 3
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
Initial implementation of the libp2p introspection server #1
Initial implementation of the libp2p introspection server #1
Conversation
TODO
|
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.
Would like to see what the fetch logic ends up looking like after integrating my review comments from libp2p/go-libp2p-core#107. Besides that, nothing controversial here so far.
@raulk The new fetch logic is up. |
@raulk Please can you explain how to determine |
sids = append(sids, introspect.StreamID(s)) | ||
} | ||
|
||
sl, err := d.tree.Stream(introspect.StreamQueryParams{introspect.QueryOutputFull, sids}) |
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.
This is fine for now, but we could further optimise this by collecting all stream IDs from all connections, and fetching them all at once, then merging them into the appropriate connections. Could you file an issue to optimise this?
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.
Done in #5
|
||
// start server | ||
serverInstance := http.Server{ | ||
// TODO Need a better strategy to select an address |
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.
Let's make sure this doesn't fall off the radar by opening an issue.
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.
Done in #6
type DefaultIntrospector struct { | ||
treeMu sync.RWMutex | ||
tree *introspect.DataProviders | ||
listenAddr []string |
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.
Modified this variable name.
} | ||
} | ||
|
||
func wsUpgrader(introspector introspect.Introspector) http.HandlerFunc { |
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.
Renamed this method.
} | ||
|
||
// send the response | ||
wsConn.SetWriteDeadline(time.Now().Add(10 * time.Second)) |
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.
Increased the timeout here.
github.com/gorilla/websocket v1.4.1 | ||
github.com/imdario/mergo v0.3.8 | ||
github.com/ipfs/go-log v1.0.1 | ||
github.com/libp2p/go-libp2p-core v0.3.1-0.20200206170018-fbc69c15df4c |
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.
This import was missing. It's locked to a commit, but it's fine for now.
For libp2p/go-libp2p#775
This is the first draft of the introspection server.