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.
|
8 years ago | |
---|---|---|
bandwidth.go | 8 years ago | |
bandwidth_test.go | 10 years ago | |
license | 8 years ago | |
readme.md | 10 years ago |
readme.md
bandwidth
bandwidth
is a little package to be used in collecting and reporting on bandwidth numbers.
It is intended to be used as such:
// report on 1, 10, 60 second intervals, update every 100 milliseconds
bw, _ := NewBandwidth([]int{1, 10, 60}, 100*time.Millisecond)
go bw.Run()
bw.AddRx <- 10
bw.AddTx <- 10
time.Sleep(1 * time.Second)
log.Printf("%+v", <-bw.Rx)
log.Printf("%+v", <-bw.Tx)