Before the dynamic queue stats only recorded when was the last time the queue was empty, the way it measured this wasn't reliable.
Now it tracks the events of incrementing and decrementing and when they occur it checks if the queue is empty to set the last time the queue was empty.
Also:
The queue has been renamed from queue to dynamicQueue
The queue stats are in a separate struct to decouple the logic of each thing.
Not the queue returns ho long has passed since it was empty (time.Duration) instead of returning a timestamp (time.Time)
Before the dynamic queue stats only recorded when was the last time the queue was empty, the way it measured this wasn't reliable.
Now it tracks the events of incrementing and decrementing and when they occur it checks if the queue is empty to set the last time the queue was empty.
Also:
queue
todynamicQueue
time.Duration
) instead of returning a timestamp (time.Time
)