Exemplo n.º 1
0
 public void CounterPayloadReceived(string providerName, ICounterPayload payload, bool _)
 {
     if (builder.Length > flushLength)
     {
         File.AppendAllText(_output, builder.ToString());
         builder.Clear();
     }
     builder.Append($"{{ \"timestamp\": \"{DateTime.Now.ToString("u")}\", ");
     builder.Append($" \"provider\": \"{providerName}\", ");
     builder.Append($" \"name\": \"{payload.GetDisplay()}\", ");
     builder.Append($" \"counterType\": \"{payload.GetCounterType()}\", ");
     builder.Append($" \"value\": {payload.GetValue()} }},");
 }
Exemplo n.º 2
0
 public void CounterPayloadReceived(string providerName, ICounterPayload payload, bool _)
 {
     if (builder.Length > flushLength)
     {
         File.AppendAllText(_output, builder.ToString());
         builder.Clear();
     }
     builder.Append(DateTime.UtcNow.ToString() + ",");
     builder.Append(providerName + ",");
     builder.Append(payload.GetDisplay() + ",");
     builder.Append(payload.GetCounterType() + ",");
     builder.Append(payload.GetValue() + "\n");
 }
Exemplo n.º 3
0
        public void CounterPayloadReceived(string providerName, ICounterPayload payload, bool _)
        {
            if (builder.Length > flushLength)
            {
                File.AppendAllText(_output, builder.ToString());
                builder.Clear();
            }

            builder
            .Append("{ \"timestamp\": \"").Append(DateTime.Now.ToString("u")).Append("\", ")
            .Append(" \"provider\": \"").Append(providerName).Append("\", ")
            .Append(" \"name\": \"").Append(payload.GetDisplay()).Append("\", ")
            .Append(" \"counterType\": \"").Append(payload.GetCounterType()).Append("\", ")
            .Append(" \"value\": ").Append(payload.GetValue().ToString(CultureInfo.InvariantCulture)).Append(" },");
        }
Exemplo n.º 4
0
        public void CounterPayloadReceived(string providerName, ICounterPayload payload, bool _)
        {
            if (builder.Length > flushLength)
            {
                File.AppendAllText(_output, builder.ToString());
                builder.Clear();
            }

            builder
            .Append(DateTime.UtcNow.ToString()).Append(',')
            .Append(providerName).Append(',')
            .Append(payload.GetDisplay()).Append(',')
            .Append(payload.GetCounterType()).Append(',')
            .Append(payload.GetValue().ToString(CultureInfo.InvariantCulture)).Append('\n');
        }