-
-
Notifications
You must be signed in to change notification settings - Fork 343
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: persist network thread profile #5628
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
@@ -125,6 +129,7 @@ export type Api = { | |||
*/ | |||
export const routesData: RoutesData<Api> = { | |||
writeHeapdump: {url: "/eth/v1/lodestar/writeheapdump", method: "POST"}, | |||
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/writenetworkthreadprofile", method: "POST"}, |
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.
Every route uses different styles:
someroute
some-route
some_route
<- let's use this one here to align with beacon APIs https://github.com/ethereum/beacon-APIs/blob/master/beacon-node-oapi.yaml
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/writenetworkthreadprofile", method: "POST"}, | |
writeNetworkThreadProfile: {url: "/eth/v1/lodestar/write_network_thread_profile", method: "POST"}, |
I can PR for the rest after merging this PR
|
||
session.post("Profiler.enable", () => { | ||
session.post("Profiler.start", async () => { | ||
await sleep(DEFAULT_PROFILE_DURATION); |
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 should be a optional parameter of the route defaulting to 1 epoch
@@ -147,6 +149,12 @@ const libp2pWorkerApi: NetworkWorkerApi = { | |||
dumpGossipPeerScoreStats: () => core.dumpGossipPeerScoreStats(), | |||
dumpDiscv5KadValues: () => core.dumpDiscv5KadValues(), | |||
dumpMeshPeers: () => core.dumpMeshPeers(), | |||
writeProfile: async (dirpath = ".") => { | |||
const profile = await profileNodeJS(); | |||
const filePath = `${dirpath}/network_thread_${new Date().toISOString()}.cpuprofile`; |
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.
Use path.join for concatenation, or path.resolve if you need an absolute path
🎉 This PR is included in v1.9.0 🎉 |
Motivation
Description
node:inspector
module to persist network thread profilepart of #5604