Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expire using prioqueue #47

Merged
7 commits merged into from
Dec 10, 2013
Merged

Conversation

mfournier
Copy link

So this is basically where I am with this attempt to maintain a pseudo-index inside the dash, to be able to sweep out elements of the display which aren't updated by the websocket stream anymore, for whatever reason. It seems to work feature-wise, but I wouldn't exclude side-effects (I'm not used to writing javascript), and performance has not been taken in account.

I'll add a more couple comments inline where I have doubts and questions.

In any case, many thanks for the guidance @aphyr ! In retrospect, I'm impressed how small this patchset finally is. The code of the dash is really easy to navigate and pleasant to read, congrats !

Marc Fournier added 7 commits December 3, 2013 22:51
Every clock tick, check if the lowest priority item in the priority
queue is in the past, and possibly expire it.

This prevents events from stalling in the dashboard forever when they
don't receive any more updates from riemann because thoses updates don't
match the query used.
... instead of a global one, which breaks when there is more than
one view per workspace
@@ -109,6 +128,12 @@ var subs = (function() {
var event = JSON.parse(e.data);
event.time = Date.parse(event.time);
clock.advance(event.time);
if (event.ttl > 0) { // only expired events have no TTL
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about that actually...

Can an event with no TTL at all arrive here ? (undefined > 0) == false, so I guess it doesn't really matter.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events with a nil TTL should use a default of, say, 60 seconds.

ghost pushed a commit that referenced this pull request Dec 10, 2013
@ghost ghost merged commit 02bfb26 into riemann:master Dec 10, 2013
@faxm0dem
Copy link

do you think this may cause backwards compatibility issues, e.g. for users who prefer the old behaviour?

@aphyr
Copy link
Collaborator

aphyr commented Dec 13, 2013

I think this design is preferable. Fixes corner cases!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants