-
Notifications
You must be signed in to change notification settings - Fork 511
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
Experimental support for more scalable coalesce #333
Conversation
service/host combination that passes through it (limited by :ttl). Every time | ||
it receives an event, it passes on *all* events it remembers. When events | ||
service/host combination that passes through it (limited by :ttl). Every second, | ||
it passes on *all* events it remembers. When events | ||
expire, they are included in the emitted sequence of events *once*, and | ||
removed from the state table thereafter. | ||
|
||
Use coalesce to combine states that arrive at different times--for instance, | ||
to average the CPU use over several hosts." | ||
[& children] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have an optional number dt
for the first argument; specifying how often to send coalesced events downstream.
I think the only thing left to to lock around the "flushing" function--I'm not sure which function you're referring to, though. |
period-manager (periodically-until-expired dt callback)] | ||
(fn [e] | ||
(.put chm [(:service e) (:host e)] e) | ||
(call-rescue e [period-manager])))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just (period-manager e) here.
This commit comes from work we did to make it possible to coalesce 50k events/second, so that riemann can be used to compute real-time aggregations of stats on large clusters.
I have pushed a candidate for merging--there is just one commit with a message explaining the motivation. |
Let me know what else I can provide, or what other changes I should make. Thanks! |
Looks good, thanks @dgrnbrg! :) |
Experimental support for more scalable coalesce
I'm opening this pull request to get your feedback on this feature--it's not ready for merging, and i'm trying to get it there. There are 2 problems I'm having now:
advance!
, the time doesn't seem to be advancing for the callback that's scheduled by theevery!
. Could this be due to thewith-redefs
intime.controlled
, or should I be reviewing my implementation? The only thing that I haven't tested is usingcall-rescue
on the children rather than invoking them directly (as I have been using previously).every!
task should be canceled when the callback is empty. Do you mind (stylewise) if I use theConcurrentHashMap
as the monitor for guarding the creation/deletion of the task withlock
?