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"); } }
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"); } }
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"); } } }
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"); } } }
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(); }