Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Initially: dequeue D of (timestamp, latency) pairs
- new point (t, l):
- while true and not empty(D):
- (t', l') := last(D)
- if l > l'
- pop_last(D)
- else
- break
- append to tail
- retrieve point:
- while not empty(D):
- (t, l) := first(D)
- if t < now - 30s:
- pop_first(D)
- else:
- return l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement