Пример #1
0
        static void ShowExample()
        {
            StatsdPipe statsd = new StatsdPipe();

            statsd.Gauge(bucketPrefix + "gauge", 500);
            statsd.Gauge("Gauge(string message, string key, int value)", bucketPrefix + "gauge", 500);
            statsd.Timing(bucketPrefix + "timer", 500);
            statsd.Timing("Timer(string message, string key, int value)", bucketPrefix + "timer", 500);
            statsd.Increment(bucketPrefix + "counter");
            statsd.Decrement(bucketPrefix + "counter");
            statsd.UpdateCount(2, bucketPrefix + "counter");
            statsd.UpdateCount(3, 0, bucketPrefix + "counter", bucketPrefix + "counter2");
            statsd.UpdateCount(4, 2, bucketPrefix + "counter", bucketPrefix + "counter2");
            statsd.UpdateCount("UpdateCount(string message, string key, int value)", 5, bucketPrefix + "counter", bucketPrefix + "counter2");
            statsd.UpdateCount("UpdateCount(string message, string key, int value)", 6, 1, bucketPrefix + "counter");
        }
Пример #2
0
 static void SendingWithoutGeyserStrategy()
 {
     Console.WriteLine("SendingWithoutGeyserStrategy");
     StatsdPipe statsd = new StatsdPipe();
     int i = 0;
     StringBuilder sb = new StringBuilder();
     sb.Append("a");
     for (i = 0; i < 10; i++)
     {
         sb.Append(sb.ToString());
     }
     Console.WriteLine(sb.Length);
     statsd.UpdateCount(1, 'a');
     statsd.Strategy = new BufferedStrategy(5000);
     while (true)
     {
         Thread.Sleep(1);
         statsd.Increment(bucketPrefix + "mailslot");
     }
 }
 public void UpdateCountTest3()
 {
     StatsdPipe target = new StatsdPipe(); // TODO: Initialize to an appropriate value
     string message = string.Empty; // TODO: Initialize to an appropriate value
     int magnitude = 0; // TODO: Initialize to an appropriate value
     string[] keys = null; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.UpdateCount(message, magnitude, keys);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }