Skip to content

Commit 18bb3da

Browse files
nonsensekaralabe
authored andcommitted
node: fill StandardCounters as part of debugapi/metrics (#16054)
1 parent dd389e5 commit 18bb3da

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎node/api.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
308308
// Fill the counter with the metric details, formatting if requested
309309
if raw {
310310
switch metric := metric.(type) {
311+
case metrics.Counter:
312+
root[name] = map[string]interface{}{
313+
"Overall": float64(metric.Count()),
314+
}
315+
311316
case metrics.Meter:
312317
root[name] = map[string]interface{}{
313318
"AvgRate01Min": metric.Rate1(),
@@ -338,6 +343,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
338343
}
339344
} else {
340345
switch metric := metric.(type) {
346+
case metrics.Counter:
347+
root[name] = map[string]interface{}{
348+
"Overall": float64(metric.Count()),
349+
}
350+
341351
case metrics.Meter:
342352
root[name] = map[string]interface{}{
343353
"Avg01Min": format(metric.Rate1()*60, metric.Rate1()),

0 commit comments

Comments
 (0)