Esempio n. 1
0
        public void Can_format_payload_correctly_without_providing_timestamp()
        {
            var textWriter = new StringWriter();
            var fieldName  = "key";
            var fieldValue = "value";
            var point      = new LineProtocolPointSingleValue("measurement", fieldName, fieldValue, MetricTags.Empty);

            point.Write(textWriter, false);

            textWriter.ToString().Should().Be("measurement key=\"value\"");
        }
Esempio n. 2
0
        public void Can_format_payload_correctly()
        {
            var textWriter = new StringWriter();
            var fieldName  = "key";
            var fieldValue = "value";
            var timestamp  = new DateTime(2017, 1, 1, 1, 1, 1, DateTimeKind.Utc);
            var point      = new LineProtocolPointSingleValue("measurement", fieldName, fieldValue, MetricTags.Empty, timestamp);

            point.Write(textWriter);

            textWriter.ToString().Should().Be("measurement key=\"value\" 1483232461000000000");
        }