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
+7 -3
View File
@@ -12,8 +12,12 @@ import (
)
var (
NotFound = ApiError(404, "Not found", nil)
ServerError = ApiError(500, "Server error", nil)
NotFound = func() Response {
return ApiError(404, "Not found", nil)
}
ServerError = func() Response {
return ApiError(500, "Server error", nil)
}
)
type Response interface {
@@ -34,7 +38,7 @@ func wrap(action interface{}) macaron.Handler {
if err == nil && val != nil && len(val) > 0 {
res = val[0].Interface().(Response)
} else {
res = ServerError
res = ServerError()
}
res.WriteTo(c.Resp)