bandwidth is a little package to be used in collecting and reporting on bandwidth numbers.

Stephen McQuay 9afe8cd2ae removed false documentation about memory leak. 1 year ago
bandwidth.go 9afe8cd2ae removed false documentation about memory leak. 1 year ago
bandwidth_test.go f161a60e37 Fixed the memory leaks using circular buffer. 3 years ago
license 26f4585249 changed license 2 years ago
readme.md 21b3c6b9e9 started readme 3 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)