Navigation Menu

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

Commit

Permalink
update profiling blog post to use shell redirection instead of -o
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Pacheco authored and isaacs committed Aug 1, 2012
1 parent f70be41 commit fe659a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/blog/Uncategorized/profiling-node-js.md
Expand Up @@ -11,8 +11,8 @@ It's incredibly easy to visualize where your Node program spends its time using
<li>Run your Node.js program as usual.</li>
<li>In another terminal, run:
<pre>
$ dtrace -o stacks.out -n 'profile-97/execname == "node" &amp;&amp; arg1/{
@[jstack(100, 8000)] = count(); } tick-60s { exit(0); }'</pre>
$ dtrace -n 'profile-97/execname == "node" &amp;&amp; arg1/{
@[jstack(150, 8000)] = count(); } tick-60s { exit(0); }' &gt; stacks.out</pre>
This will sample about 100 times per second for 60 seconds and emit results to stacks.out. <strong>Note that this will sample all running programs called "node". If you want a specific process, replace <code>execname == "node"</code> with <code>pid == 12345</code> (the process id).</strong>
</li>
<li>Use the "stackvis" tool to transform this directly into a flame graph. First, install it:
Expand Down

0 comments on commit fe659a6

Please sign in to comment.