bps is used to keep track of bandwidth rates
https://godoc.org/mcquay.me/bps
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
7 years ago | |
---|---|---|
bps.go | 8 years ago | |
bps_test.go | 8 years ago | |
bytes.go | 8 years ago | |
example_multi_test.go | 7 years ago | |
license | 8 years ago | |
multi.go | 7 years ago | |
readme.md | 7 years ago |
readme.md
bps
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())