~/talk

Fun with async hooks and stack traces

Talkat WFH Conf 2020 · on Thursday, 2020-03-26· [nodejs, observability]
slides:none on file

Uses async_hooks to capture init stacks and then counts actual Promise allocations, measures event-loop blocking by comparing before/after timestamps, and extracts the declaration line with error.captureStackTrace so the exact function that stalled the loop is reported. Builds an npm tool debugging-aid package with helpers: a blocked-at tracer that prints file/line and duration, a package-firewall that detects which dependency opens network sockets via monkey‑patching, and a trace-events exporter that visualizes promise lifetimes — demos show these tools work on real examples.

AI-written summary · about

  1. 0:00Start
  2. 8:46What Are Chasing Hooks
  3. 16:29Find Out Which Function Is Blocking the Event Loop
  4. 18:00Capture Stacktrace
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.