How do you check the current statistics and configuration of an existing Bloom filter, such as its capacity and current false positive rate?
Short answer
You use the BF.INFO command with the filter's key name, which returns details including the filter's configured capacity, the number of items currently added, the number of internal filters used if the filter has scaled beyond its original capacity, and other useful diagnostic…
Advertisement
AModel answer
You use the BF.INFO command with the filter's key name, which returns details including the filter's configured capacity, the number of items currently added, the number of internal filters used if the filter has scaled beyond its original capacity, and other useful diagnostic information about its current state.
Example
BF.INFO my_filter
Real-world example
A team monitoring their Bloom filter's health checks BF.INFO periodically, confirming the filter has not unexpectedly grown far beyond its originally planned capacity in a way that might be affecting its accuracy or memory usage.
Likely follow-ups
- What happens to a Bloom filter's accuracy if it exceeds its originally configured capacity?
- How do you resize a Bloom filter that has grown beyond its planned capacity?
Related topics