设为首页 加入收藏

TOP

基于Redis扩展模块的布隆过滤器使用(三)
2019-09-23 18:11:07 】 浏览:114
Tags:基于 Redis 扩展 模块 布隆 过滤器 使用
else: key = redis_conn.scan(cursor=cursor,match='*', count=5000) cursor = key[0] if len(key[1]) > 0: for var in key[1]: if str(redis_conn.type(var), encoding = "utf-8") == 'MBbloom--': info = redis_conn.debug_object(var) dict_key[var] = float(info['serializedlength']) / 1024 / 1024 # byte ---> mb res = sorted(dict_key.items(), key=lambda dict_key: dict_key[1], reverse=True) for i in range(10 if len(res) > 10 else len(res)): print(res[i]) if __name__ == "__main__": get_bf_bigkeys()

统计结果示例如下

[root@tencent02 redis8001]# python3 static_big_bf_keys.py
(b'bloom_filter_test', 4.000059127807617)
(b'my_bf2', 0.04577445983886719)
(b'bloom_filter_test2', 0.00014019012451171875)
(b'my_bf1', 0.0001220703125)
[root@tencent02 redis8001]#

 

参考:

https://redislabs.com/blog/rebloom-bloom-filter-datatype-redis/

https://oss.redislabs.com/redisbloom/Bloom_Commands/

首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL的逻辑查询语句的执行顺序 下一篇MySQL:Specified key was too lon..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目