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

Added to the API #6

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

Conversation

natemueller
Copy link
Contributor

I want to be able to merge together estimators and stick the result in memcache. Needed the following methods to do that:

HyperEstimator#merge!
HyperEstimator#_dump
HyperEstimator.load

I also changed HyperEstimator.estimate to take an array of estimators as well as a list

Nate Mueller added 13 commits July 3, 2012 20:23
Previously, if you passed in n estimators it would merge n[0] with
itself n-1 times.
Tests still pass on 1.8
Conflicts:
	ext/hyperloglog.cpp
	spec/hyperloglog_spec.rb
Conflicts:
	spec/hyperloglog_spec.rb
You could do HyperEstimator.estimate(*estimators) but that will blow
the stack on long lists.
I want to pull a bunch of estimators out of the database,
merge them and cache the result
My primary use case is stuffing these into memcache
builder = HyperBuilder.new(12)
10.times { builder.offer(rand.to_s) }

se = 10 * (1.04 / Math.sqrt(2**12))

Choose a reason for hiding this comment

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

se variable isn't even used, is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that looks like a leftover

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.

None yet

2 participants