feat(instrumentation): added meter, histogram and new timer, timer now send p25, p75, p90, p99 percentiles in 1000 sample exp decaying sample

This commit is contained in:
Torkel Ödegaard
2016-06-03 12:50:51 +02:00
parent 86f0007768
commit eee49a4995
20 changed files with 2133 additions and 226 deletions
+2 -2
View File
@@ -39,12 +39,12 @@ func Logger() macaron.Handler {
rw := res.(macaron.ResponseWriter)
c.Next()
timeTakenMs := int64(time.Since(start) / time.Millisecond)
timeTakenMs := time.Since(start) / time.Millisecond
content := fmt.Sprintf("Completed %s %s \"%s %s %s\" %v %s %d bytes in %dms", c.RemoteAddr(), uname, req.Method, req.URL.Path, req.Proto, rw.Status(), http.StatusText(rw.Status()), rw.Size(), timeTakenMs)
if timer, ok := c.Data["perfmon.timer"]; ok {
timerTyped := timer.(metrics.Timer)
timerTyped.AddTiming(timeTakenMs)
timerTyped.Update(timeTakenMs)
}
switch rw.Status() {