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

Experimental support for more scalable coalesce #333

Merged
merged 1 commit into from
Mar 11, 2014
Merged

Experimental support for more scalable coalesce #333

merged 1 commit into from
Mar 11, 2014

Conversation

dgrnbrg
Copy link
Contributor

@dgrnbrg dgrnbrg commented Mar 6, 2014

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:

  1. Even though I'm using advance!, the time doesn't seem to be advancing for the callback that's scheduled by the every!. Could this be due to the with-redefs in time.controlled, or should I be reviewing my implementation? The only thing that I haven't tested is using call-rescue on the children rather than invoking them directly (as I have been using previously).
  2. I know that the every! task should be canceled when the callback is empty. Do you mind (stylewise) if I use the ConcurrentHashMap as the monitor for guarding the creation/deletion of the task with lock?

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]
Copy link
Collaborator

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.

@dgrnbrg
Copy link
Contributor Author

dgrnbrg commented Mar 6, 2014

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]))))
Copy link
Collaborator

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.
@dgrnbrg
Copy link
Contributor Author

dgrnbrg commented Mar 6, 2014

I have pushed a candidate for merging--there is just one commit with a message explaining the motivation.

@dgrnbrg
Copy link
Contributor Author

dgrnbrg commented Mar 10, 2014

Let me know what else I can provide, or what other changes I should make. Thanks!

@aphyr
Copy link
Collaborator

aphyr commented Mar 11, 2014

Looks good, thanks @dgrnbrg! :)

aphyr added a commit that referenced this pull request Mar 11, 2014
Experimental support for more scalable coalesce
@aphyr aphyr merged commit 1f1fbde into riemann:master Mar 11, 2014
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.

2 participants