started readme
This commit is contained in:
parent
c465ab2c91
commit
21b3c6b9e9
18
readme.md
Normal file
18
readme.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
bandwidth
|
||||||
|
=========
|
||||||
|
|
||||||
|
`bandwidth` is a little package to be used in collecting and reporting on bandwidth numbers.
|
||||||
|
|
||||||
|
It is intended to be used as such:
|
||||||
|
|
||||||
|
|
||||||
|
```go
|
||||||
|
// 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)
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user