hyperdrive-network-speed
hyperdrive-network-speed copied to clipboard
track upload and download speed on a hyperdrive archive [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
More info on active projects and modules at dat-ecosystem.org ![]()
hyperdrive-network-speed
Get upload and download speeds for a hyperdrive archive.
Usage
var archive = hyperdrive('.dat')
var swarm = hyperdiscovery(archive)
var speed = networkSpeed(archive, {timeout: 1000})
setInterval(function () {
console.log('upload speed: ', speed.uploadSpeed)
console.log('download speed: ', speed.downloadSpeed)
}, 500)
API
var speed = networkSpeed(archive, [opts])
archiveis a hyperdrive archive.opts.timeoutis the only option. Speed will be reset to zero after the timeout.
speed.uploadSpeed
Archive upload speed across all peers.
speed.downloadSpeed
Archive download speed across all peers.
speed.downloadTotal
Archive total download.
speed.uploadTotal
Archive total upload.
License
MIT