Exemplo n.º 1
0
        public void Format(TextWriter textWriter)
        {
            if (textWriter == null)
            {
                throw new ArgumentNullException(nameof(textWriter));
            }

            textWriter.Write("# MEASUREMENT: ");
            textWriter.Write(Measurement);
            textWriter.Write('\n');

            if (Tags.Count > 0)
            {
                textWriter.Write("# TAGS:\n");

                for (var i = 0; i < Tags.Count; i++)
                {
                    textWriter.Write(AsciiSyntax.FormatReadable(Tags.Keys[i], AsciiSyntax.FormatValue(Tags.Values[i])));
                    textWriter.Write('\n');
                }
            }

            textWriter.Write("# FIELDS:\n");

            foreach (var f in Fields)
            {
                textWriter.Write(AsciiSyntax.FormatReadable(f.Key, AsciiSyntax.FormatValue(f.Value)));
                textWriter.Write('\n');
            }

            textWriter.Write("--------------------------------------------------------------");
        }
Exemplo n.º 2
0
        public void Format(TextWriter textWriter)
        {
            if (textWriter == null)
            {
                throw new ArgumentNullException(nameof(textWriter));
            }

            textWriter.Write("# CHECK: ");
            textWriter.Write(Name);
            textWriter.Write('\n');
            textWriter.Write('\n');
            textWriter.Write(AsciiSyntax.FormatReadable("MESSAGE", Message));
            textWriter.Write('\n');
            textWriter.Write(AsciiSyntax.FormatReadable("STATUS", Status.ToString()));

            textWriter.Write("\n--------------------------------------------------------------");
        }