Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
85a2f235
Commit
85a2f235
authored
Apr 18, 2014
by
antirez
Browse files
PFCOUNT multi-key test added.
parent
5eb7ac0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/hyperloglog.tcl
View file @
85a2f235
...
@@ -136,6 +136,21 @@ start_server {tags {"hll"}} {
...
@@ -136,6 +136,21 @@ start_server {tags {"hll"}} {
r pfcount hll
r pfcount hll
}
{
5
}
}
{
5
}
test
{
PFCOUNT multiple-keys merge returns cardinality of union
}
{
r del hll1 hll2 hll3
for
{
set x 1
}
{
$x
< 10000
}
{
incr x
}
{
# Force dense representation of hll2
r pfadd hll1
"foo-
$x
"
r pfadd hll2
"bar-
$x
"
r pfadd hll3
"zap-
$x
"
set card
[
r pfcount hll1 hll2 hll3
]
set realcard
[
expr
{
$x
*3
}]
set err
[
expr
{
abs
(
$card-$realcard
)}]
assert
{
$err
<
(
double
(
$card
)
/100
)
*5
}
}
}
test
{
PFDEBUG GETREG returns the HyperLogLog raw registers
}
{
test
{
PFDEBUG GETREG returns the HyperLogLog raw registers
}
{
r del hll
r del hll
r pfadd hll 1 2 3
r pfadd hll 1 2 3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment