June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package metrics import ( "net/http" "time" metrics "github.com/rcrowley/go-metrics" ) // CounterHandler will update a counter each time it's called func CounterHandler(w http.ResponseWriter, r *http.Request) { c := metrics.GetOrRegisterCounter("counterhandler.counter", nil) c.Inc(1) w.WriteHeader(http.StatusOK) w.Write([]byte("success")) } // TimerHandler records ...Read now
Unlock full access