mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 00:31:21 +00:00
HyperLogLog: make API use the P prefix in honor of Philippe Flajolet.
This commit is contained in:
@ -18,9 +18,9 @@ while true do
|
||||
elements << ele
|
||||
i += 1
|
||||
}
|
||||
r.hlladd('hll',*elements)
|
||||
r.padd('hll',*elements)
|
||||
}
|
||||
approx = r.hllcount('hll')
|
||||
approx = r.pcount('hll')
|
||||
abs_err = (approx-i).abs
|
||||
rel_err = 100.to_f*abs_err/i
|
||||
puts "#{i} vs #{approx}: #{rel_err}%"
|
||||
|
@ -30,9 +30,9 @@ def run_experiment(r,seed,max,step)
|
||||
elements << ele
|
||||
i += 1
|
||||
}
|
||||
r.hlladd('hll',*elements)
|
||||
r.padd('hll',*elements)
|
||||
}
|
||||
approx = r.hllcount('hll')
|
||||
approx = r.pcount('hll')
|
||||
err = approx-i
|
||||
rel_err = 100.to_f*err/i
|
||||
samples << [i,rel_err]
|
||||
|
Reference in New Issue
Block a user