bps is used to keep track of bandwidth rates https://godoc.org/mcquay.me/bps

Stephen McQuay 3398b4f131 added example 10 months ago
bps.go 9e977f19c6 Added BPS.Data to feed to sparklines 1 year ago
bps_test.go 9e977f19c6 Added BPS.Data to feed to sparklines 1 year ago
bytes.go 561fc4300f don't show docs for human 1 year ago
example_multi_test.go 3398b4f131 added example 10 months ago
license 16519f1bcf fixed author name 1 year ago
multi.go 323daff95b added multi 10 months ago
readme.md c6935de403 Update godoc link 10 months ago

readme.md

bps

GoDoc

bps is used to keep track of bandwidth rates

It is intended to be used as such:

// report on the rate over a 60 second interval, update every second
bw, _ := New(60*time.Second)
bw.Add(10)
b := &bytes.Buffer{}
b.Write([]byte("helloooooooooooooooooooooooooooooooooooooooooooooo"))
io.Copy(bw, b)
time.Sleep(1 * time.Second)
log.Printf("%+v", bw.HumanRate())