Ejemplo n.º 1
0
        public void With_Prefix_String()
        {
            NStatsDClient.GlobalBucketPrefix = NStatsDClient.GetBucketName("machineName", "applicationName");
            var bucket = NStatsDClient.With("test.gauge");

            Assert.AreEqual("machineName.applicationName.test.gauge", bucket.Name);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            NStatsDClient.GlobalBucketPrefix = NStatsDClient.GetBucketName(Environment.MachineName, "NStatsDDemo");

            Random random = new Random();

            var timedStat = NStatsDClient.With("test.timer").BeginTimer();

            NStatsDClient.With("test.increment").Increment();
            NStatsDClient.With("test.decrement").Decrement();
            NStatsDClient.With("test", "gauge").Gauge(random.Next(0, 100));
            NStatsDClient.WithoutPrefix("NStatsDDemo.NoPrefix.Gauge").Gauge(89);

            var timeSpan = timedStat.EndTimer();

            //for (int i = 0; i < 100; i++)
            //{
            //    var ms = random.Next(100, 800);
            //    Console.WriteLine(ms);
            //    NStatsDClient.With("prefixed", "timing4").Timing(TimeSpan.FromMilliseconds(ms));
            //    Thread.Sleep(10000);
            //}
        }
Ejemplo n.º 3
0
        public void With_NoPrefix_StringArray()
        {
            var bucket = NStatsDClient.With("test", "gauge");

            Assert.AreEqual("test.gauge", bucket.Name);
        }