Esempio n. 1
0
        public void HyperLogLogTest()
        {
            redisHelper.HyperLogLogAdd("ip_20180723", new RedisValue[5] {
                "192.168.1.1", "192.168.1.2", "192.168.1.3", "192.168.1.3", "192.168.1.10"
            });
            redisHelper.HyperLogLogAdd("ip_20180724", new RedisValue[3] {
                "192.168.1.3", "192.168.1.4", "192.168.1.5"
            });
            redisHelper.HyperLogLogAdd("ip_20180725", new RedisValue[3] {
                "192.168.1.6", "192.168.1.7", "192.168.1.8"
            });

            //合集
            redisHelper.HyperLogLogMerge("ip_201807", new List <string> {
                "ip_20180723", "ip_20180724", "ip_20180725"
            });

            Console.WriteLine($"ip_20180723的数量:{redisHelper.HyperLogLogLength("ip_20180723")}");
            Console.WriteLine($"ip_20180724的数量:{redisHelper.HyperLogLogLength("ip_20180724")}");
            Console.WriteLine($"ip_20180725的数量:{redisHelper.HyperLogLogLength("ip_20180725")}");
            Console.WriteLine($"ip_20180723与ip_20180724合集的数量:{redisHelper.HyperLogLogLength(new List<string> { "ip_20180723" , "ip_20180724" })}");
            Console.WriteLine($"ip_201807的数量:{redisHelper.HyperLogLogLength("ip_201807")}");
        }