Beispiel #1
0
        public static void CounterRegularWithTags()
        {
            var tags = new Dictionary <string, string>
            {
                ["foo"]     = "bar",
                ["another"] = "tag"
            };
            var message = StatsDMessage.Counter(128, "bucket", tags);

            Check(message, "prefix.bucket;foo=bar;another=tag:128|c");
        }
Beispiel #2
0
        public void BufferBased()
        {
            Dictionary <string, string> tags = new Dictionary <string, string>();

            tags.Add("key", " value");
            tags.Add("key2", " value2");

            FormatterBuffer.TryFormat(StatsDMessage.Gauge(255, "some.neat.bucket", null), 1, Buffer, out _);
            FormatterBuffer.TryFormat(StatsDMessage.Timing(255, "some.neat.bucket", null), 1, Buffer, out _);
            FormatterBuffer.TryFormat(StatsDMessage.Counter(255, "some.neat.bucket", null), 1, Buffer, out _);
            FormatterBuffer.TryFormat(StatsDMessage.Gauge(255, "some.neat.bucket", tags), 1, Buffer, out _);
            FormatterBuffer.TryFormat(StatsDMessage.Timing(255, "some.neat.bucket", tags), 1, Buffer, out _);
            FormatterBuffer.TryFormat(StatsDMessage.Counter(255, "some.neat.bucket", tags), 1, Buffer, out _);
        }
Beispiel #3
0
 public void BufferBased()
 {
     FormatterBuffer.TryFormat(StatsDMessage.Gauge(255, "some.neat.bucket"), 1, Buffer, out _);
     FormatterBuffer.TryFormat(StatsDMessage.Timing(255, "some.neat.bucket"), 1, Buffer, out _);
     FormatterBuffer.TryFormat(StatsDMessage.Counter(255, "some.neat.bucket"), 1, Buffer, out _);
 }
Beispiel #4
0
        public static void CounterNegative()
        {
            var message = StatsDMessage.Counter(-128, "bucket");

            Check(message, "prefix.bucket:-128|c");
        }
Beispiel #5
0
        public static void CounterRegular()
        {
            var message = StatsDMessage.Counter(128, "bucket");

            Check(message, "prefix.bucket:128|c");
        }
Beispiel #6
0
        public static void CounterSampled()
        {
            var message = StatsDMessage.Counter(128, "bucket");

            Check(message, 0.5, "prefix.bucket:128|c|@0.5");
        }