Пример #1
0
        static void TestMailSlotStreaming()
        {
            GeyserStrategy strategy = new GeyserStrategy();
            strategy.Interval = 2000;

            StatsdPipe statsd = new StatsdPipe();
            statsd.Strategy = strategy;

            for (int i=0; i<1000; i++)
            {
                Thread.Sleep(r.Next(5));
                statsd.Increment(bucketPrefix + "mailslot");
            }
        }
Пример #2
0
        static void TestMailSlotStreaming()
        {
            GeyserStrategy strategy = new GeyserStrategy();

            strategy.Interval = 2000;

            StatsdPipe statsd = new StatsdPipe();

            statsd.Strategy = strategy;

            for (int i = 0; i < 1000; i++)
            {
                Thread.Sleep(r.Next(5));
                statsd.Increment(bucketPrefix + "mailslot");
            }
        }
Пример #3
0
 static void TestUnderPressure()
 {
     StatsdPipe statsd = new StatsdPipe();
     statsd.Send = new TransportMock().Send;
     GeyserStrategy stra = new GeyserStrategy();
     stra.Interval = 0.5;
     statsd.Strategy = stra;
     for (int i=0; i<10000; i++){
         DateTime start = DateTime.Now;
         statsd.Increment(bucketPrefix + "pressure.multiple1");
         int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
         statsd.Timing(bucketPrefix + "pressure.incr_time", elapsedTimeMillis);
         if (i%3==0){
             statsd.Increment(bucketPrefix + "pressure.multiple3");
         }
     }
 }
Пример #4
0
        static void TestUnderPressure()
        {
            StatsdPipe statsd = new StatsdPipe();

            statsd.Send = new TransportMock().Send;
            GeyserStrategy stra = new GeyserStrategy();

            stra.Interval   = 0.5;
            statsd.Strategy = stra;
            for (int i = 0; i < 10000; i++)
            {
                DateTime start = DateTime.Now;
                statsd.Increment(bucketPrefix + "pressure.multiple1");
                int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
                statsd.Timing(bucketPrefix + "pressure.incr_time", elapsedTimeMillis);
                if (i % 3 == 0)
                {
                    statsd.Increment(bucketPrefix + "pressure.multiple3");
                }
            }
        }
Пример #5
0
        public void ThreadPoolCallback(Object threadContext)
        {
            StatsdPipe statsd = new StatsdPipe();

            statsd.Send = new TransportMock().Send;
            GeyserStrategy stra = new GeyserStrategy();

            stra.Interval   = 0.5;
            statsd.Strategy = stra;
            int threadIndex = (int)threadContext;

            for (int i = 0; i < 100; i++)
            {
                //Thread.Sleep(r.Next(5));
                DateTime start = DateTime.Now;
                statsd.Increment(bucketPrefix + "threadpool.thread" + threadIndex);
                int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
                statsd.Timing(bucketPrefix + "threadpool.incr_time", elapsedTimeMillis);
            }
            doneEvent.Set();
        }
Пример #6
0
 public void ThreadPoolCallback(Object threadContext)
 {
     StatsdPipe statsd = new StatsdPipe();
     statsd.Send = new TransportMock().Send;
     GeyserStrategy stra = new GeyserStrategy();
     stra.Interval = 0.5;
     statsd.Strategy = stra;
     int threadIndex = (int)threadContext;
     for (int i = 0; i < 100; i++)
     {
         //Thread.Sleep(r.Next(5));
         DateTime start = DateTime.Now;
         statsd.Increment(bucketPrefix + "threadpool.thread" + threadIndex);
         int elapsedTimeMillis = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
         statsd.Timing(bucketPrefix + "threadpool.incr_time", elapsedTimeMillis);
     }
     doneEvent.Set();
 }