librato/librato-metrics — pull request #16 by josephruscio (2012-03-26 01:43:49+00:00)
Title: Initial Aggregation Support

Candidate for implementing an `Aggregate` type that plays a similar role to statsd in-process. Utilizes the [Aggregate gem](https://github.com/josephruscio/aggregate) underneath the hood.

Tried to leverage as much existing code from the Queue type as possible. It's currently copied, but clearly marked as so. Let me know if a mixin or base class is preferred to DRY that out and I'll fix it. This mixin/base class is probably where we'll want to add the time-based submission, so both Aggregate/Queue can take advantage of it.

Only open issue I wasn't sure how to handle was instantiating top-level `Aggregate`'s from inside `Librato::Metrics::Aggregate`. Using `Module::Aggregate` works, but it throws a warning. Longer term solution is to clean up and make Aggregate more ruby-ish (my first gem ever from 2009 o_O), but it seems like there should be some way to make the current implementation work.