@@ -193,11 +193,6 @@ func (self *debugApi) Metrics(req *shared.Request) (interface{}, error) {
193
193
format := func (total float64 , rate float64 ) string {
194
194
return fmt .Sprintf ("%s (%s/s)" , round (total , 0 ), round (rate , 2 ))
195
195
}
196
- // Create the percentile units
197
- percentiles := make ([]float64 , 101 )
198
- for i := 0 ; i <= 100 ; i ++ {
199
- percentiles [i ] = float64 (i ) / 100
200
- }
201
196
// Iterate over all the metrics, and just dump for now
202
197
counters := make (map [string ]interface {})
203
198
metrics .DefaultRegistry .Each (func (name string , metric interface {}) {
@@ -220,21 +215,23 @@ func (self *debugApi) Metrics(req *shared.Request) (interface{}, error) {
220
215
"AvgRate05Min" : metric .Rate5 (),
221
216
"AvgRate15Min" : metric .Rate15 (),
222
217
"MeanRate" : metric .RateMean (),
223
- "Total" : float64 (metric .Count ()),
218
+ "Overall" : float64 (metric .Count ()),
224
219
}
225
220
226
221
case metrics.Timer :
227
- ps := make (map [string ]interface {})
228
- for i , p := range metric .Percentiles (percentiles ) {
229
- ps [fmt .Sprintf ("%d" , i )] = p
230
- }
231
222
root [name ] = map [string ]interface {}{
232
223
"AvgRate01Min" : metric .Rate1 (),
233
224
"AvgRate05Min" : metric .Rate5 (),
234
225
"AvgRate15Min" : metric .Rate15 (),
235
226
"MeanRate" : metric .RateMean (),
236
- "Total" : float64 (metric .Count ()),
237
- "Percentiles" : ps ,
227
+ "Overall" : float64 (metric .Count ()),
228
+ "Percentiles" : map [string ]interface {}{
229
+ "5" : metric .Percentile (0.05 ),
230
+ "20" : metric .Percentile (0.2 ),
231
+ "50" : metric .Percentile (0.5 ),
232
+ "80" : metric .Percentile (0.8 ),
233
+ "95" : metric .Percentile (0.95 ),
234
+ },
238
235
}
239
236
240
237
default :
@@ -247,23 +244,23 @@ func (self *debugApi) Metrics(req *shared.Request) (interface{}, error) {
247
244
"Avg01Min" : format (metric .Rate1 ()* 60 , metric .Rate1 ()),
248
245
"Avg05Min" : format (metric .Rate5 ()* 300 , metric .Rate5 ()),
249
246
"Avg15Min" : format (metric .Rate15 ()* 900 , metric .Rate15 ()),
250
- "Total" : format (float64 (metric .Count ()), metric .RateMean ()),
247
+ "Overall" : format (float64 (metric .Count ()), metric .RateMean ()),
251
248
}
252
249
253
250
case metrics.Timer :
254
251
root [name ] = map [string ]interface {}{
255
252
"Avg01Min" : format (metric .Rate1 ()* 60 , metric .Rate1 ()),
256
253
"Avg05Min" : format (metric .Rate5 ()* 300 , metric .Rate5 ()),
257
254
"Avg15Min" : format (metric .Rate15 ()* 900 , metric .Rate15 ()),
258
- "Total" : format (float64 (metric .Count ()), metric .RateMean ()),
255
+ "Overall" : format (float64 (metric .Count ()), metric .RateMean ()),
259
256
"Maximum" : time .Duration (metric .Max ()).String (),
260
257
"Minimum" : time .Duration (metric .Min ()).String (),
261
258
"Percentiles" : map [string ]interface {}{
259
+ "5" : time .Duration (metric .Percentile (0.05 )).String (),
262
260
"20" : time .Duration (metric .Percentile (0.2 )).String (),
263
261
"50" : time .Duration (metric .Percentile (0.5 )).String (),
264
262
"80" : time .Duration (metric .Percentile (0.8 )).String (),
265
263
"95" : time .Duration (metric .Percentile (0.95 )).String (),
266
- "99" : time .Duration (metric .Percentile (0.99 )).String (),
267
264
},
268
265
}
269
266
0 commit comments