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

Add aggregation type support #4

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

ciaranj
Copy link

@ciaranj ciaranj commented Oct 15, 2012

Based on top of the work done by @cwholt further fixes and an implementation of the aggregation method support, so now when aggregating to lower precision archives 'max, min, sum, last and average' can be used instead of just always averaging (the same as python's whisper)

christopher holt and others added 18 commits October 17, 2011 13:18
added "../lib" path to requiring buffer_ieee754, was breaking otherwise.
…t is out of bounds"

try/catch on all fs.read handles this, but does not solve it.
This reverts commit ea2181b.
The XFilesFactor that was being passed to the create method
was being ignored previously.  Now it isn't.

Signed-off-by: ciaranj <[email protected]>
Previously calls to updateMany would ultimately have their
data discarded, as concat does not mutate the existing
arrays but returns a new one, the python-ported algorithm
doesn't quite apply.

Signed-off-by: ciaranj <[email protected]>
This change may be un-acceptable :(.  If Hoard.js is used within the same
process as statsd (as for example a back-end) then it is possible that hoard
will refuse updates from statsD's flush event as the timestamp that
statsd generates will appear to be from the future.

This is because Hoard.js was using:

  parseInt( new Date().getTime() / 1000 )

But statsd is using :

  Math.round( new Date().getTime() / 1000 )

To get their idea of 'now'.  Most of the time this will be ok, but if
a the result of the division contains a fractional part greater than or
equal to .5 then statsd will round-up to the next nearest integer value
but Hoard was truncating (discarding?) the fractional part, meaning
it would be (as far as it was concerned) timestamps from the future
when update was called sufficiently quickly after the flush.

Signed-off-by: ciaranj <[email protected]>
Much like commit 0cc664 in the python whisper project,
this commit introduces support for specifying the aggregation type
(one of 'sum', 'max', 'min', 'last' or 'average') when propagating
values into the lower precision archives.

This commit also bumps the package number as it introduces a breaking
change to the create interface by making the xFilesFactor and new
aggregationMethod arguments optional (defaulting to 0.5 and average
respectively). Following semver.org recommendations that means a bump
to the middle value :)

Signed-off-by: ciaranj <[email protected]>
@ciaranj
Copy link
Author

ciaranj commented Oct 15, 2012

Be aware of @3c8b006 that might be contentious!

@jnovack
Copy link

jnovack commented Aug 19, 2014

3c8b006 is "contentious" but needed for compatibility. I like it. Let's get it merged!

@ciaranj
Copy link
Author

ciaranj commented Aug 21, 2014

Just so you're aware, I've stopped working on this library, and moved over to https://github.com/ciaranj/ceres/tree/nodejs_port might be of use :)

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