package
0.28.0
Repository: https://github.com/ten-protocol/go-ten.git
Documentation: pkg.go.dev

# README

This package contains code related to the node's host metrics system.

The metrics package heavily uses geths own metric package.

  • golang Package here
  • Documentation here

Add metrics

Instrumentation can be added and used as the following example shows:


import gethmetrics "github.com/ethereum/go-ethereum/metrics"

type SomeStruct struct {
        ...
        someMeter gethmetrics.Meter
        someGauge gethmetrics.Gauge
}

// registry should be passed down from the parent package
func New(registry gethmetrics.Registry) *SomeStruct {
	return &SomeStruct {
            someMeter : gethmetrics.NewRegisteredMeter("some/metric/path", registry),
            someGauge : gethmetrics.NewRegisteredGauge("some/metric/path", registry), 
        }
}

func (s *SomeStruct) Do()  {
	//some other code
        s.someMeter.Update(Some_Value)
	s.someGauge.Inc(1)
}

# Functions

No description provided by the author

# Structs

Service provides the metrics for the host it registers the gethmetrics Registry and handles the metrics server.