Skip to content

Instantly share code, notes, and snippets.

@tjfontaine
Created July 5, 2013 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjfontaine/5937328 to your computer and use it in GitHub Desktop.
Save tjfontaine/5937328 to your computer and use it in GitHub Desktop.
### sub headings only work in the second ## subheading, not in the first

Tracing

Stability: 2 - Unstable

This is a description of the tracing points exported for use with tools like
DTrace, ETW, and
SystemTap. If your version of node was compiled
with these enabled you don't need to take any further action in your code to
use them.

Examples

This is not meant to be documentation on how to use a specific tracing
platform. For information on how to use these tools please refer to their
respective documentation.

DTrace

The following is a simple example that will work on Illumos, OS X, and FreeBSD.
It will print the remote IP address, http method, and url for a given request
as it comes in.

/Users/tjfontaine/Development/node/tools/doc/generate.js:105
if (er) throw er;
^
Error: Inappropriate heading level
{"type":"heading","depth":3,"text":"DTrace"}
at /Users/tjfontaine/Development/node/tools/doc/json.js:55:19
at Array.forEach (native)
at doJSON (/Users/tjfontaine/Development/node/tools/doc/json.js:36:9)
at next (/Users/tjfontaine/Development/node/tools/doc/generate.js:103:27)
at /Users/tjfontaine/Development/node/tools/doc/generate.js:91:18
at processIncludes (/Users/tjfontaine/Development/node/tools/doc/generate.js:63:33)
at /Users/tjfontaine/Development/node/tools/doc/generate.js:84:7
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)

Tracing

Stability: 2 - Unstable

Works

This is a description of the tracing points exported for use with tools like
DTrace, ETW, and
SystemTap. If your version of node was compiled
with these enabled you don't need to take any further action in your code to
use them.

Examples

This is not meant to be documentation on how to use a specific tracing platform. For information on how to use these tools please refer to their respective documentation.

DTrace

The following is a simple example that will work on Illumos, OS X, and FreeBSD. It will print the remote IP address, http method, and url for a given request as it comes in.

@tjfontaine
Copy link
Author

    if (type === 'heading' &&
        !text.trim().match(/^example/i)) {
      if (tok.depth - depth > 1) {
        return cb(new Error('Inappropriate heading level\n'+
                            JSON.stringify(tok)));
      }

It's only a problem because I called it Examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment