Close buffer in #readme example
This commit is contained in:
parent
89d7c1f584
commit
e8dbc2aa55
|
@ -19,7 +19,7 @@ import (
|
|||
func handleMetrics(rw http.ResponseWriter, req *http.Request) {
|
||||
ua := parseUserAgent(req.UserAgent())
|
||||
geo := fetchGeoInfo(req.RemoteAddr)
|
||||
|
||||
|
||||
buf.Add(
|
||||
&influxdb.Series{
|
||||
Name: "app.browsers",
|
||||
|
@ -44,8 +44,10 @@ var (
|
|||
|
||||
func main() {
|
||||
buf = buffer.New(100, writeMetrics)
|
||||
defer buf.Close()
|
||||
|
||||
http.HandleFunc("/metrics", handleMetrics)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue