Returns the elapsed time, in milliseconds since the instance was created
Returns the initial value, or undefined
Returns number of recorded values (this can include the initial value)
Optional
opts: TrackedValueOptsDifference between last value and initial. Eg. if last value was 10 and initial value was 5, 5 is returned (10 - 5) If either of those is missing, undefined is returned
When trimmed, recomputes to set total/min/max to be based on current values.
Relative difference between last value and initial. Eg if last value was 10 and initial value was 5, 2 is returned (200%)
Reset tracker
Adds a value, returning computed result.
At this point, we check if the buffer is larger than resetAfterSamples
. If so, reset()
is called.
If not, we check sampleLimit
. If the buffer is twice as large as sample limit, trimStore()
is
called to take it down to sample limit, and onTrimmed()
is called.
Reduces size of value store to limit
. Returns
number of remaining items
A
Tracker
that tracks interval between calls tomark()