internal static void CheckArrayPoolLeak <TK, TV>(IDataStreamerClient <TK, TV> streamer)
        {
            var streamerImpl = (DataStreamerClient <TK, TV>)streamer;

            TestUtils.WaitForCondition(() => streamerImpl.ArraysAllocated == streamerImpl.ArraysPooled, 1000);

            Assert.AreEqual(streamerImpl.ArraysAllocated, streamerImpl.ArraysPooled, "Pooled arrays should not leak.");

            Console.WriteLine("Array pool size: " + streamerImpl.ArraysPooled);
        }
        public void Setup()
        {
            // Create streamers and warm them up.
            ThinStreamer  = Client.GetDataStreamer <int, int>(CacheName);
            ThickStreamer = ThickClient.GetDataStreamer <int, int>(CacheName);

            for (int i = 0; i < DataStreamerDefaults.DefaultPerNodeBufferSize * 10; i++)
            {
                ThinStreamer.Add(-i, -i);
                ThickStreamer.Add(i, i);
            }

            ThickStreamer.Flush();
            ThinStreamer.Flush();

            Cache.Clear();
        }