package flow
Import Path
github.com/libp2p/go-flow-metrics (on go.dev)
Dependency Relation
imports 6 packages, and imported by one package
Package-Level Type Names (total 3)
Meter is a meter for monitoring a flow.
Mark updates the total.
Reset sets accumulator, total and rate to zero.
Snapshot gets a snapshot of the total and rate.
(*Meter) String() string
*Meter : expvar.Var
*Meter : fmt.Stringer
func NewMeter() *Meter
func (*MeterRegistry).Get(name string) *Meter
MeterRegistry is a registry for named meters.
Clear removes all meters from the registry.
FindIdle finds all meters that haven't been used since the given time.
ForEach calls the passed function for each registered meter.
Get gets (or creates) a meter by name.
Remove removes the named meter from the registry.
Note: The only reason to do this is to save a bit of memory. Unused meters
don't consume any CPU (after they go idle).
TrimIdle trims that haven't been updated since the given time. Returns the
number of timers trimmed.
Package-Level Functions (total 2)
NewMeter returns a new Meter with the correct idle time.
While zero-value Meters can be used, their "last update" time will start at
the program start instead of when the meter was created.
SetClock sets a clock to use in the sweeper.
This will probably only ever be useful for testing purposes.
Package-Level Variables (only one)
IdleRate the rate at which we declare a meter idle (and stop tracking it
until it's re-registered).
The default ensures that 1 event every ~30s will keep the meter from going
idle.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |