mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
metrics: docs
This commit is contained in:
parent
754c0c8211
commit
6bf03617e0
5 changed files with 6 additions and 8 deletions
|
|
@ -34,8 +34,7 @@ type CounterSnapshot int64
|
|||
// Count returns the count at the time the snapshot was taken.
|
||||
func (c CounterSnapshot) Count() int64 { return int64(c) }
|
||||
|
||||
// Counter is the standard implementation of a Counter and uses the
|
||||
// sync/atomic package to manage a single int64 value.
|
||||
// Counter hold an int64 value that can be incremented and decremented.
|
||||
type Counter atomic.Int64
|
||||
|
||||
// Clear sets the counter to zero.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ type CounterFloat64Snapshot float64
|
|||
// Count returns the value at the time the snapshot was taken.
|
||||
func (c CounterFloat64Snapshot) Count() float64 { return float64(c) }
|
||||
|
||||
// CounterFloat64 is the uses atomic to manage a single float64 value.
|
||||
// CounterFloat64 holds a float64 value that can be incremented and decremented.
|
||||
type CounterFloat64 atomic.Uint64
|
||||
|
||||
// Clear sets the counter to zero.
|
||||
|
|
|
|||
|
|
@ -34,9 +34,8 @@ func NewEWMA15() *EWMA {
|
|||
return NewEWMA(1 - math.Exp(-5.0/60.0/15))
|
||||
}
|
||||
|
||||
// EWMA imlements an exponential weighted moving average. It tracks the number
|
||||
// of uncounted events and processes them on each tick. It uses the
|
||||
// sync/atomic package to manage uncounted events.
|
||||
// EWMA continuously calculate an exponentially-weighted moving average
|
||||
// based on an outside source of clock ticks.
|
||||
type EWMA struct {
|
||||
uncounted atomic.Int64
|
||||
alpha float64
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func NewRegisteredGauge(name string, r Registry) *Gauge {
|
|||
return c
|
||||
}
|
||||
|
||||
// Gauge and uses the sync/atomic package to manage a single int64 value.
|
||||
// Gauge holds an int64 value that can be set arbitrarily.
|
||||
type Gauge atomic.Int64
|
||||
|
||||
// Snapshot returns a read-only copy of the gauge.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func NewRegisteredGaugeFloat64(name string, r Registry) *GaugeFloat64 {
|
|||
return c
|
||||
}
|
||||
|
||||
// GaugeFloat64 and uses atomic to manage a single float64 value.
|
||||
// GaugeFloat64 hold a float64 value that can be set arbitrarily.
|
||||
type GaugeFloat64 atomic.Uint64
|
||||
|
||||
// Snapshot returns a read-only copy of the gauge.
|
||||
|
|
|
|||
Loading…
Reference in a new issue