Exemplo n.º 1
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);
        }
Exemplo n.º 2
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, annotation.Value);
     writer.Write(comma);
     writer.WriteAnchor(endpoint);
     SerializeEndPoint(writer, endPoint, serviceName);
     writer.Write(closingBrace);
 }
Exemplo n.º 3
0
 public void AddAnnotation(ZipkinAnnotation annotation)
 {
     Annotations.Add(annotation);
 }
Exemplo n.º 4
0
 private bool TryGetAnnotation(string annotationType, out ZipkinAnnotation annotation)
 {
     annotation = Annotations.FirstOrDefault(a => a.Value.Equals(annotationType));
     return(annotation != default(ZipkinAnnotation));
 }
Exemplo n.º 5
0
 private bool TryGetServerRecv(out ZipkinAnnotation serverRecvAnnotation)
 {
     return(TryGetAnnotation(zipkinCoreConstants.SERVER_RECV, out serverRecvAnnotation));
 }
Exemplo n.º 6
0
 private bool TryGetClientSend(out ZipkinAnnotation clientSendAnnotation)
 {
     return(TryGetAnnotation(zipkinCoreConstants.CLIENT_SEND, out clientSendAnnotation));
 }