For the given operation, op
, the stats and frequencyAccumulator
will be updated or initialized if they don't already exist.
Calculates and returns the timeout for the next update based on the urgency of the update.
Resets the timeout for triggering updates.
If there are items in the queue, they will will be processed and
the frequency for all items will be updated based on the Timestamp
of the last item in the queue. The update
event will also be emitted
with the latest stats.
If there are no items in the queue, no action is taken.
For each key in the stats, the frequency and moving averages will be updated via Stats._updateFrequencyFor based on the time difference between calls to this method.
Updates the movingAverages
for the given key
and also
resets the frequencyAccumulator
for the key
.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Returns a clone of the internal movingAverages
Returns a clone of the current stats.
Pushes the given operation data to the queue, along with the current Timestamp, then resets the update timer.
Initializes the internal timer if there are items in the queue. This
should only need to be called if Stats.stop
was previously called, as
Stats.push
will also start the processing.
Stops processing and computing of stats by clearing the internal timer.
Returns a plain JSON object of the stats
A queue based manager for stat processing