static void TestMultiThreading()
        {
            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            for (int i = 0; i < doneEvents.Length; i++)
            {
                doneEvents[i] = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix);
                ThreadPool.QueueUserWorkItem(tps.ThreadPoolCallback, i);
            }

            WaitHandle.WaitAll(doneEvents);
        }
        static void TestMultiThreading()
        {
            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            for (int i = 0; i < doneEvents.Length; i++)
            {
                doneEvents[i] = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix);
                ThreadPool.QueueUserWorkItem(tps.ThreadPoolCallback, i);
            }

            WaitHandle.WaitAll(doneEvents);
        }
        static void TestMultiThreading()
        {
            Console.WriteLine("TestMultiThreading");
            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            for (int i = 0; i < doneEvents.Length; i++)
            {
                StatsdPipe statsd = new StatsdPipe();
                statsd.Transport = new TransportMock();
                statsd.Strategy  = new BufferedStrategy(500);
                doneEvents[i]    = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix, statsd);
                ThreadPool.QueueUserWorkItem(tps.SendMessages, i);
            }

            WaitHandle.WaitAll(doneEvents);
        }
        static void TestMultiThreading2()
        {
            Console.WriteLine("TestMultiThreading (CB)");
            DateTime start = DateTime.Now;

            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            StatsdPipe         statsd     = new StatsdPipe();

            //statsd.Transport = new TransportMock();
            statsd.Strategy = new BufferedStrategy(2000);
            for (int i = 0; i < doneEvents.Length; i++)
            {
                doneEvents[i] = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix, statsd);
                ThreadPool.QueueUserWorkItem(tps.SendMessages, i);
            }

            WaitHandle.WaitAll(doneEvents);
            int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);

            Console.WriteLine("Test took: " + elapsedTimeMillis + " msec");
        }
Beispiel #5
0
        static void TestMultiThreading2()
        {
            Console.WriteLine("TestMultiThreading (CB)");
            DateTime start = DateTime.Now;
            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            StatsdPipe statsd = new StatsdPipe();
            //statsd.Transport = new TransportMock();
            statsd.Strategy = new BufferedStrategy(2000);
            for (int i = 0; i < doneEvents.Length; i++)
            {
                doneEvents[i] = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix, statsd);
                ThreadPool.QueueUserWorkItem(tps.SendMessages, i);
            }

            WaitHandle.WaitAll(doneEvents);
            int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
            Console.WriteLine("Test took: " + elapsedTimeMillis + " msec");
        }
Beispiel #6
0
        static void TestMultiThreading()
        {
            Console.WriteLine("TestMultiThreading");
            ManualResetEvent[] doneEvents = new ManualResetEvent[10];
            for (int i = 0; i < doneEvents.Length; i++)
            {
                StatsdPipe statsd = new StatsdPipe();
                statsd.Transport = new TransportMock();
                statsd.Strategy = new BufferedStrategy(500);
                doneEvents[i] = new ManualResetEvent(false);
                ThreadPoolStatsd tps = new ThreadPoolStatsd(doneEvents[i], bucketPrefix, statsd);
                ThreadPool.QueueUserWorkItem(tps.SendMessages, i);
            }

            WaitHandle.WaitAll(doneEvents);
        }