diff options
author | antirez <antirez@gmail.com> | 2014-03-31 22:48:01 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-03-31 22:48:01 +0200 |
commit | 5afcca34ce5a87c933b48ada9076025c7b76b8bf (patch) | |
tree | ed2ca2d1b39be27b310a2be4ec20ffb5e42b1316 /utils/hyperloglog | |
parent | ba4e20835a769eb1934bed41b00155e3c9f448c8 (diff) | |
download | redis-5afcca34ce5a87c933b48ada9076025c7b76b8bf.tar.gz |
HyperLogLog API prefix modified from "P" to "PF".
Using both the initials of Philippe Flajolet instead of just "P".
Diffstat (limited to 'utils/hyperloglog')
-rw-r--r-- | utils/hyperloglog/hll-err.rb | 4 | ||||
-rw-r--r-- | utils/hyperloglog/hll-gnuplot-graph.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/utils/hyperloglog/hll-err.rb b/utils/hyperloglog/hll-err.rb index 8481844bc..75bb8e424 100644 --- a/utils/hyperloglog/hll-err.rb +++ b/utils/hyperloglog/hll-err.rb @@ -18,9 +18,9 @@ while true do elements << ele i += 1 } - r.padd('hll',*elements) + r.pfadd('hll',*elements) } - approx = r.pcount('hll') + approx = r.pfcount('hll') abs_err = (approx-i).abs rel_err = 100.to_f*abs_err/i puts "#{i} vs #{approx}: #{rel_err}%" diff --git a/utils/hyperloglog/hll-gnuplot-graph.rb b/utils/hyperloglog/hll-gnuplot-graph.rb index 41e7f717a..6d80adf05 100644 --- a/utils/hyperloglog/hll-gnuplot-graph.rb +++ b/utils/hyperloglog/hll-gnuplot-graph.rb @@ -30,9 +30,9 @@ def run_experiment(r,seed,max,step) elements << ele i += 1 } - r.padd('hll',*elements) + r.pfadd('hll',*elements) } - approx = r.pcount('hll') + approx = r.pfcount('hll') err = approx-i rel_err = 100.to_f*err/i samples << [i,rel_err] |