Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rate ¶
type Rate struct {
// contains filtered or unexported fields
}
Rate is an exponentially weighted moving average event rate. The rate is always calculated per second and samples are summed up within the second duration.
func New ¶
New creates a new rate with a given lifetime.
lifetime is the time required for the decaying quantity to reduced to 1⁄e ≈ 0.367879441 times its initial value.
func NewHalfLife ¶
NewHalfLife creates a new rate with a given half-life.
halflife is the time required for the decaying quantity to fall to one half of its initial value.
func (*Rate) LastUpdate ¶
Click to show internal directories.
Click to hide internal directories.