1
0
Fork 0

Close buffer in #readme example

This commit is contained in:
Gregory Eremin 2014-08-12 15:24:33 +07:00
parent 89d7c1f584
commit e8dbc2aa55
No known key found for this signature in database
GPG Key ID: 5EFA427EEC26E86C
1 changed files with 4 additions and 2 deletions

View File

@ -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)
}
```
```