Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Update STATS.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias authored Feb 6, 2018
1 parent aa14b5f commit 3814b29
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions SPEC/STATS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ ipfs.stats.bw((err, stats) => console.log(stats))

Options are described on [`ipfs.stats.bw`](#bw).

**Example:**

```JavaScript
const pull = require('pull-stream')
const log = require('pull-stream/sinks/log')
Expand Down Expand Up @@ -86,6 +88,23 @@ pull(

Options are described on [`ipfs.stats.bw`](#bw).

**Examples:**

```JavaScript
const stream = ipfs.stats.bwReadableStream({ poll: true })

stream.pipe(bl((err, data) => {
console.log(data)
}))

// { totalIn: Big {...},
// totalOut: Big {...},
// rateIn: Big {...},
// rateOut: Big {...} }
// ...
// Ad infinitum
```

[big]: https://github.com/MikeMcl/big.js/
[rs]: https://www.npmjs.com/package/readable-stream
[ps]: https://www.npmjs.com/package/pull-stream

0 comments on commit 3814b29

Please sign in to comment.