nebulasio / go-nebulas

Official Go implementation of the Nebulas protocol.
https://nebulas.io
GNU Lesser General Public License v3.0
712 stars 203 forks source link

Add more metrics in Nebulas #24

Closed LeonLi000 closed 6 years ago

LeonLi000 commented 6 years ago

Nebulas metrics system is based on the go-metrics library. We use influxdb to store the metrics data. And we use grafana to fetch data from the InfluxDB database and draw diagrams.

Creating and updating metrics

Metrics can be created and updated equally simply:

meter := metrics.NewMeter(metername)
timer := metrics.NewTimer(timername)

meter.Mark(n) // Record the occurrence of `n` events
timer.Update(duration)  // Record an event that took `duration`
timer.UpdateSince(time) // Record an event that started at `time`

metrics data display on grafana

image

Now we have add some necessary metrics in Nebulas. But we need more.

LeonLi000 commented 6 years ago

@fbzhong Now we have some different kinds of metrics.

This 7dd69fec1abf535a2418e1475d42bf444d491bf0 commit update the feature.