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

Commit 3814b29

Browse files
authored
Update STATS.md
1 parent aa14b5f commit 3814b29

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

SPEC/STATS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ ipfs.stats.bw((err, stats) => console.log(stats))
5757

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

60+
**Example:**
61+
6062
```JavaScript
6163
const pull = require('pull-stream')
6264
const log = require('pull-stream/sinks/log')
@@ -86,6 +88,23 @@ pull(
8688

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

91+
**Examples:**
92+
93+
```JavaScript
94+
const stream = ipfs.stats.bwReadableStream({ poll: true })
95+
96+
stream.pipe(bl((err, data) => {
97+
console.log(data)
98+
}))
99+
100+
// { totalIn: Big {...},
101+
// totalOut: Big {...},
102+
// rateIn: Big {...},
103+
// rateOut: Big {...} }
104+
// ...
105+
// Ad infinitum
106+
```
107+
89108
[big]: https://github.com/MikeMcl/big.js/
90109
[rs]: https://www.npmjs.com/package/readable-stream
91110
[ps]: https://www.npmjs.com/package/pull-stream

0 commit comments

Comments
 (0)