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:
+7
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user