Пример #1
0
 private static void SerializeAnnotation(StreamWriter writer, ZipkinAnnotation annotation, IPEndPoint endPoint, string serviceName)
 {
     writer.Write(openingBrace);
     writer.WriteField(timestamp, annotation.Timestamp.ToUnixTimestamp());
     writer.Write(comma);
     writer.WriteField(value, SerializerUtils.ToEscaped(annotation.Value));
     writer.Write(comma);
     writer.WriteAnchor(endpoint);
     SerializeEndPoint(writer, endPoint, serviceName);
     writer.Write(closingBrace);
 }
Пример #2
0
        /// <summary>
        /// Convert this annotation object to its Thrift equivalent.
        /// </summary>
        /// <returns></returns>
        public static Thrift.Annotation ConvertToThrift(ZipkinAnnotation zipkinAnnotation, Thrift.Endpoint host)
        {
            var thriftAnn = new Thrift.Annotation
            {
                Timestamp = zipkinAnnotation.Timestamp.ToUnixTimestamp(),
                Value     = zipkinAnnotation.Value,
                Host      = host
            };

            return(thriftAnn);
        }
Пример #3
0
 public void AddAnnotation(ZipkinAnnotation annotation)
 {
     Annotations.Add(annotation);
 }
Пример #4
0
 private bool TryGetAnnotation(string annotationType, out ZipkinAnnotation annotation)
 {
     annotation = Annotations.FirstOrDefault(a => a.Value.Equals(annotationType));
     return(annotation != default(ZipkinAnnotation));
 }
Пример #5
0
 private bool TryGetServerRecv(out ZipkinAnnotation serverRecvAnnotation)
 {
     return(TryGetAnnotation(zipkinCoreConstants.SERVER_RECV, out serverRecvAnnotation));
 }
Пример #6
0
 private bool TryGetClientSend(out ZipkinAnnotation clientSendAnnotation)
 {
     return(TryGetAnnotation(zipkinCoreConstants.CLIENT_SEND, out clientSendAnnotation));
 }