base/bif/cardinality-counter.bif.zeek
- GLOBAL
Functions to create and manipulate probabilistic cardinality counters.
- Namespace
GLOBAL
Summary
Functions
Adds an element to a HyperLogLog cardinality counter. |
|
Copy a HLL cardinality counter. |
|
Estimate the current cardinality of an HLL cardinality counter. |
|
Initializes a probabilistic cardinality counter that uses the HyperLogLog algorithm. |
|
Merges a HLL cardinality counter into another. |
Detailed Interface
Functions
- hll_cardinality_add
-
Adds an element to a HyperLogLog cardinality counter.
- Handle
the HLL handle.
- Elem
the element to add.
- Returns
true on success.
See also:
hll_cardinality_estimate
,hll_cardinality_merge_into
,hll_cardinality_init
,hll_cardinality_copy
- hll_cardinality_copy
-
Copy a HLL cardinality counter.
- Handle
cardinality counter to copy.
- Returns
copy of handle.
See also:
hll_cardinality_estimate
,hll_cardinality_merge_into
,hll_cardinality_add
,hll_cardinality_init
- hll_cardinality_estimate
-
Estimate the current cardinality of an HLL cardinality counter.
- Handle
the HLL handle.
- Returns
the cardinality estimate. Returns -1.0 if the counter is empty.
See also:
hll_cardinality_merge_into
,hll_cardinality_add
,hll_cardinality_init
,hll_cardinality_copy
- hll_cardinality_init
-
Initializes a probabilistic cardinality counter that uses the HyperLogLog algorithm.
- Err
the desired error rate (e.g. 0.01).
- Confidence
the desired confidence for the error rate (e.g., 0.95).
- Returns
a HLL cardinality handle.
See also:
hll_cardinality_estimate
,hll_cardinality_merge_into
,hll_cardinality_add
,hll_cardinality_copy
- hll_cardinality_merge_into
-
Merges a HLL cardinality counter into another.
Note
The same restrictions as for Bloom filter merging apply, see
bloomfilter_merge
.- Handle1
the first HLL handle, which will contain the merged result.
- Handle2
the second HLL handle, which will be merged into the first.
- Returns
true on success.
See also:
hll_cardinality_estimate
,hll_cardinality_add
,hll_cardinality_init
,hll_cardinality_copy