public void WritesJustFields()
        {
            var now      = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
            var expected = $"test foo=42i {now}\n";

            var obj       = new { foo = 42 };
            var formatter = new InfluxLineWriter("test", obj.GetType(), new DiagnosticListenerOptions());

            var memory = ArrayPool <byte> .Shared.Rent(1024);

            var span = memory.AsSpan();

            formatter.TryWrite(span, obj, null, now, out int written);
            var str = Encoding.UTF8.GetString(memory, 0, written);

            Assert.Equal(expected, str);
            ArrayPool <byte> .Shared.Return(memory);
        }
        public void WritesTagsAndFields_WithFormattedNames()
        {
            var now      = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
            var expected = $"test,TAG=foo FOO=42i {now}\n";
            var options  = new DiagnosticListenerOptions();

            options.TagNameFormatter   = n => n.ToUpperInvariant();
            options.FieldNameFormatter = n => n.ToUpperInvariant();

            var obj       = new { tag = "foo", foo = 42 };
            var formatter = new InfluxLineWriter("test", obj.GetType(), options);

            var memory = ArrayPool <byte> .Shared.Rent(1024);

            var span = memory.AsSpan();

            formatter.TryWrite(span, obj, null, now, out int written);
            var str = Encoding.UTF8.GetString(memory, 0, written);

            Assert.Equal(expected, str);
            ArrayPool <byte> .Shared.Return(memory);
        }