bandwidth is a little package to be used in collecting and reporting on bandwidth numbers.
Go to file
Stephen McQuay 4f912b29ba just a test of branching semantics 2014-03-08 14:40:21 -08:00
.hgignore demote NewStream 2014-03-02 22:47:28 -08:00
bandwidth.go just a test of branching semantics 2014-03-08 14:40:21 -08:00
bandwidth_test.go Started down a different path; using a circular buffer instead. 2014-03-08 00:45:55 -08:00
license.md added license 2014-03-02 23:10:11 -08:00
readme.md started readme 2014-03-02 23:10:16 -08:00

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)