aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@byzantine-lab.io>2019-06-29 21:25:16 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-09-17 16:57:30 +0800
commit2c0344ff1803b790d44031a8f2ddf154ac806997 (patch)
tree8411f52d4db59472b20ecce32b728df4db8a384a
parentfc8421afacee4c6e332bbb91606d58b9a11413cc (diff)
downloadgo-tangerine-2c0344ff1803b790d44031a8f2ddf154ac806997.tar.gz
go-tangerine-2c0344ff1803b790d44031a8f2ddf154ac806997.tar.zst
go-tangerine-2c0344ff1803b790d44031a8f2ddf154ac806997.zip
node: add support for gauge metrics
-rw-r--r--node/api.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/node/api.go b/node/api.go
index 02de526f4..ccca8ca36 100644
--- a/node/api.go
+++ b/node/api.go
@@ -344,6 +344,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
"Overall": float64(metric.Count()),
}
+ case metrics.Gauge:
+ root[name] = map[string]interface{}{
+ "Overall": float64(metric.Value()),
+ }
+
case metrics.Meter:
root[name] = map[string]interface{}{
"AvgRate01Min": metric.Rate1(),