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

Commit aa14b5f

Browse files
authored
Update STATS.md
1 parent 49defc6 commit aa14b5f

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

SPEC/STATS.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,36 @@ ipfs.stats.bw((err, stats) => console.log(stats))
4949

5050
#### `bwPullStream`
5151

52-
> Get IPFS bandwidth information as an [Pull Stream][ps].
52+
> Get IPFS bandwidth information as a [Pull Stream][ps].
5353
5454
##### `Go` **WIP**
5555

5656
##### `JavaScript` - ipfs.stats.bwPullStream([options]) -> [Pull Stream][ps]
5757

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

60+
```JavaScript
61+
const pull = require('pull-stream')
62+
const log = require('pull-stream/sinks/log')
63+
64+
const stream = ipfs.stats.bwReadableStream({ poll: true })
65+
66+
pull(
67+
stream,
68+
log()
69+
)
70+
71+
// { totalIn: Big {...},
72+
// totalOut: Big {...},
73+
// rateIn: Big {...},
74+
// rateOut: Big {...} }
75+
// ...
76+
// Ad infinitum
77+
```
78+
6079
#### `bwReadableStream`
6180

62-
> Get IPFS bandwidth information as an [Readable Stream][rs].
81+
> Get IPFS bandwidth information as a [Readable Stream][rs].
6382
6483
##### `Go` **WIP**
6584

0 commit comments

Comments
 (0)