Browse Source

started readme

Stephen McQuay 5 years ago
parent
commit
21b3c6b9e9
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      readme.md

+ 18
- 0
readme.md View File

@@ -0,0 +1,18 @@
1
+bandwidth
2
+=========
3
+
4
+`bandwidth` is a little package to be used in collecting and reporting on bandwidth numbers.
5
+
6
+It is intended to be used as such:
7
+
8
+
9
+```go
10
+    // report on 1, 10, 60 second intervals, update every 100 milliseconds
11
+	bw, _ := NewBandwidth([]int{1, 10, 60}, 100*time.Millisecond)
12
+	go bw.Run()
13
+	bw.AddRx <- 10
14
+	bw.AddTx <- 10
15
+	time.Sleep(1 * time.Second)
16
+	log.Printf("%+v", <-bw.Rx)
17
+    log.Printf("%+v", <-bw.Tx)
18
+```

Loading…
Cancel
Save