You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: SPEC/BITSWAP.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,15 @@ Bitswap API
17
17
18
18
`callback` must follow `function (err, stats) {}` signature, where `err` is an error if the operation was not successful. `stats` is an Object containing the following keys:
19
19
20
-
-`provideBufLen`
20
+
-`provideBufLen` is an integer.
21
21
-`wantlist` (array)
22
22
-`peers` (array)
23
-
-`blocksReceived`
24
-
-`dataReceived`
25
-
-`blocksSent`
26
-
-`dataSent`
27
-
-`dupBlksReceived`
28
-
-`dupDataReceived`
23
+
-`blocksReceived` is a [Big Int][1]
24
+
-`dataReceived` is a [Big Int][1]
25
+
-`blocksSent` is a [Big Int][1]
26
+
-`dataSent` is a [Big Int][1]
27
+
-`dupBlksReceived` is a [Big Int][1]
28
+
-`dupDataReceived` is a [Big Int][1]
29
29
30
30
If no `callback` is passed, a promise is returned.
Copy file name to clipboardExpand all lines: SPEC/REPO.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,11 +42,11 @@ Where:
42
42
43
43
`callback` must follow `function (err, stats) {}` signature, where `err` is an Error if the operation was not successful and `stats` is an object containing the following keys:
44
44
45
-
-`numObjects`
46
-
-`repoSize`
47
-
-`repoPath`
48
-
-`version`
49
-
-`storageMax`
45
+
-`numObjects` is a [Big Int][1].
46
+
-`repoSize` is a [Big Int][1], in bytes.
47
+
-`repoPath` is a string.
48
+
-`version` is a string.
49
+
-`storageMax` is a [Big Int][1].
50
50
51
51
If no `callback` is passed, a promise is returned.
Copy file name to clipboardExpand all lines: SPEC/STATS.md
+74-10Lines changed: 74 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Stats API
11
11
12
12
#### `bw`
13
13
14
-
> Adds an IPFS object to the pinset and also stores it to the IPFS repo. pinset is the set of hashes currently pinned (not gc'able).
14
+
> Get IPFS bandwidth information as an object.
15
15
16
16
##### `Go`**WIP**
17
17
@@ -25,12 +25,14 @@ Where:
25
25
-`poll` is used to print bandwidth at an interval.
26
26
-`interval` is the time interval to wait between updating output, if `poll` is true.
27
27
28
-
`callback` must follow `function (err, stats) {}` signature, where `err` is an error if the operation was not successful.`stats` is an Object containing the following keys:
28
+
`callback` must follow `function (err, stat) {}` signature, where `err` is an Error if the operation was not successful.
29
29
30
-
-`totalIn`
31
-
-`totalOut`
32
-
-`rateIn`
33
-
-`rateOut`
30
+
`stat` is, in both cases, an Object containing the following keys:
31
+
32
+
-`totalIn` - is a [Big Int][big], in bytes.
33
+
-`totalOut` - is a [Big Int][big], in bytes.
34
+
-`rateIn` - is a [Big Int][big], in bytes.
35
+
-`rateOut` - is a [Big Int][big], in bytes.
34
36
35
37
If no `callback` is passed, a promise is returned.
36
38
@@ -39,8 +41,70 @@ If no `callback` is passed, a promise is returned.
39
41
```JavaScript
40
42
ipfs.stats.bw((err, stats) =>console.log(stats))
41
43
42
-
// { totalIn: 15456,
43
-
// totalOut: 15420,
44
-
// rateIn: 905.0873512246716,
45
-
// rateOut: 893.7400053359125 }
44
+
// { totalIn: Big {...},
45
+
// totalOut: Big {...},
46
+
// rateIn: Big {...},
47
+
// rateOut: Big {...} }
48
+
```
49
+
50
+
#### `bwPullStream`
51
+
52
+
> Get IPFS bandwidth information as a [Pull Stream][ps].
0 commit comments