Example #1
0
        public void TimeSlotHashing_Cluster()
        {
            int total = 0;
            var watch = Stopwatch.StartNew();

            unchecked
            {
                for (int i = 0; i < LOOP; i++)
                {
                    total += RedisCluster.HashSlot("GetSetValues" + i);
                }
            }
            watch.Stop();
            Console.WriteLine("Time to hash {0}: {1}ms ({2})", LOOP, watch.ElapsedMilliseconds, total);
        }
Example #2
0
 public void HashingAlgo()
 {  // this example taken from Appendix A of the specification
     Assert.AreEqual(0x31C3, RedisCluster.HashSlot(Encoding.UTF8.GetBytes("123456789")));
 }