stats.bitswap
and bitswap.stat
can be used interchangeably. See bitswap.stat
for more details.
stats.repo
and repo.stat
can be used interchangeably. See repo.stat
for more details.
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).
Where:
options
is an opcional object that might contain the following keys:peer
specifies a peer to print bandwidth for.proto
specifies a protocol to print bandwidth for.poll
is used to print bandwidth at an interval.interval
is the time interval to wait between updating output, ifpoll
is true.
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:
totalIn
totalOut
rateIn
rateOut
If no callback
is passed, a promise is returned.
Example:
ipfs.stats.bw((err, stats) => console.log(stats))
// { totalIn: 15456,
// totalOut: 15420,
// rateIn: 905.0873512246716,
// rateOut: 893.7400053359125 }