summaryrefslogtreecommitdiff
path: root/utils/hyperloglog
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-03-31 19:16:47 +0200
committerantirez <antirez@gmail.com>2014-03-31 19:29:40 +0200
commite887c62e451e94dfb096a31f95888615cd2d7291 (patch)
tree81b3ef1f00b911ccf3a1bff00bedbfbb8995f606 /utils/hyperloglog
parentf1b76081281ca088a95401cf074ab8ccce6005fa (diff)
downloadredis-e887c62e451e94dfb096a31f95888615cd2d7291.tar.gz
HyperLogLog: make API use the P prefix in honor of Philippe Flajolet.
Diffstat (limited to 'utils/hyperloglog')
-rw-r--r--utils/hyperloglog/hll-err.rb4
-rw-r--r--utils/hyperloglog/hll-gnuplot-graph.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/utils/hyperloglog/hll-err.rb b/utils/hyperloglog/hll-err.rb
index c40cfc7c3..8481844bc 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.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}%"
diff --git a/utils/hyperloglog/hll-gnuplot-graph.rb b/utils/hyperloglog/hll-gnuplot-graph.rb
index 20d7b35aa..41e7f717a 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.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]