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

Showcasing some new profiling tools at the next WG meeting #186

Closed
mafintosh opened this issue Apr 27, 2018 · 2 comments
Closed

Showcasing some new profiling tools at the next WG meeting #186

mafintosh opened this issue Apr 27, 2018 · 2 comments

Comments

@mafintosh
Copy link
Member

mafintosh commented Apr 27, 2018

With clinic, https://github.com/nearform/node-clinic, we've been working on some new fun and interesting ideas on how to profile and visualize async flow. It's getting to a state where we'd love to share some of stuff we've made so far with the diagnostics WG to get some feedback. I believe @mcollina and @AndreasMadsen also presented a very early version of it at the last summit

The tool itself profiles code like this:

const fs = require('fs')
const util = require('util')
const http = require('http')

const service = util.promisify(fs.readFile).bind(null, __filename)

const server = http.createServer(async function (req, res) {
  const [a, b, c] = await Promises.all(service(), service(), service())

  res.end(Buffer.concat([a, b, c]))
})

server.listen(3000)

And turns into a UI like this:

2018-04-27-114517_1920x1080_scrot

Where each bubble represents async/sync time spent on operations. The line between the bubbles represents the flow, with longer lines meaning longer latencies. Most of this is powered by async_hooks and trace events.

Would love to do a short demo at the next WG meeting if possible, on Wed the 2nd of May :)

@mhdawson
Copy link
Member

Would love to see that but won't be able to make the next meeting.

@mmarchini
Copy link
Contributor

Reminder @nodejs/diagnostics: if you want early access to this tool, reach out to @mafintosh or @mcollina.

I'm closing this issue since the tool was shown at the last meeting (congratulations btw, looks like a promising tool 😄). If you believe there's anything else to be discussed here feel free to reopen.

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

No branches or pull requests

3 participants