Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IdleRate = 1e-13
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.
Functions ¶
This section is empty.
Types ¶
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Meter is a meter for monitoring a flow.
type MeterRegistry ¶
type MeterRegistry struct {
// contains filtered or unexported fields
}
MeterRegistry is a registry for named meters.
func (*MeterRegistry) ForEach ¶
func (r *MeterRegistry) ForEach(iterFunc func(string, *Meter))
ForEach calls the passed function for each registered meter.
func (*MeterRegistry) Get ¶
func (r *MeterRegistry) Get(name string) *Meter
Get gets (or creates) a meter by name.
func (*MeterRegistry) Remove ¶
func (r *MeterRegistry) Remove(name string)
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).
Click to show internal directories.
Click to hide internal directories.