|
|
@ -308,6 +308,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) { |
|
|
|
// Fill the counter with the metric details, formatting if requested
|
|
|
|
// Fill the counter with the metric details, formatting if requested
|
|
|
|
if raw { |
|
|
|
if raw { |
|
|
|
switch metric := metric.(type) { |
|
|
|
switch metric := metric.(type) { |
|
|
|
|
|
|
|
case metrics.Counter: |
|
|
|
|
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
|
|
|
|
"Overall": float64(metric.Count()), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case metrics.Meter: |
|
|
|
case metrics.Meter: |
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
"AvgRate01Min": metric.Rate1(), |
|
|
|
"AvgRate01Min": metric.Rate1(), |
|
|
@ -338,6 +343,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
switch metric := metric.(type) { |
|
|
|
switch metric := metric.(type) { |
|
|
|
|
|
|
|
case metrics.Counter: |
|
|
|
|
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
|
|
|
|
"Overall": float64(metric.Count()), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case metrics.Meter: |
|
|
|
case metrics.Meter: |
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
root[name] = map[string]interface{}{ |
|
|
|
"Avg01Min": format(metric.Rate1()*60, metric.Rate1()), |
|
|
|
"Avg01Min": format(metric.Rate1()*60, metric.Rate1()), |
|
|
|