Skip to content

Commit

Permalink
Merge pull request #5 from ulikoehler/master
Browse files Browse the repository at this point in the history
Add markdown syntax highlighting
  • Loading branch information
davepacheco committed Jan 15, 2013
2 parents 4bf33b1 + 009985a commit cbead6b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -45,20 +45,20 @@ formats:

Client code shouldn't load these directly. Instead, require 'stackvis' and use
lookupReader and lookupWriter:

var mod_stackvis = require('stackvis');
var dtrace_reader = mod_stackvis.lookupReader('dtrace')
var collapsed_writer = mod_stackvis.lookupWriter('collapsed');

```javascript
var mod_stackvis = require('stackvis');
var dtrace_reader = mod_stackvis.lookupReader('dtrace')
var collapsed_writer = mod_stackvis.lookupWriter('collapsed');
```
The main operation is translating from one representation to another (e.g.,
DTrace output to a flame graph) using pipeStacks() (which requires a Bunyan
logger):

var mod_bunyan = require('bunyan');
var log = new mod_bunyan({ 'name': 'mytool', 'stream': process.stderr });
mod_stackvis.pipeStacks(log, process.stdin, dtrace_reader, collapsed_writer,
process.stdout, function () { console.error('translation finished'); });

```javascript
var mod_bunyan = require('bunyan');
var log = new mod_bunyan({ 'name': 'mytool', 'stream': process.stderr });
mod_stackvis.pipeStacks(log, process.stdin, dtrace_reader, collapsed_writer,
process.stdout, function () { console.error('translation finished'); });
```
This example instantiates a new dtrace_reader to read DTrace output from
process.stdin and then emits the result in collapsed form to process.stdout
through the collapsed_writer.
Expand Down

0 comments on commit cbead6b

Please sign in to comment.