Example #1
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }

            if (!(o is ZipkinSpan))
            {
                return(false);
            }

            ZipkinSpan that = (ZipkinSpan)o;

            return(TraceId.Equals(that.TraceId) &&
                   ((ParentId == null) ? (that.ParentId == null) : ParentId.Equals(that.ParentId)) &&
                   Id.Equals(that.Id) &&
                   Kind.Equals(that.Kind) &&
                   ((Name == null) ? (that.Name == null) : Name.Equals(that.Name)) &&
                   (Timestamp == that.Timestamp) &&
                   (Duration == that.Duration) &&
                   ((LocalEndpoint == null) ? (that.LocalEndpoint == null) : LocalEndpoint.Equals(that.LocalEndpoint)) &&
                   ((RemoteEndpoint == null) ? (that.RemoteEndpoint == null) : RemoteEndpoint.Equals(that.RemoteEndpoint)) &&
                   Annotations.SequenceEqual(that.Annotations) &&
                   Tags.SequenceEqual(that.Tags) &&
                   (Debug == that.Debug) &&
                   (Shared == that.Shared));
        }
Example #2
0
        public Property Identical64BitTraceIdsShouldBeEqual(long traceIdLow)
        {
            var traceId1 = new TraceId(traceIdLow);
            var traceId2 = new TraceId(traceIdLow);

            return(traceId1.Equals(traceId2).ToProperty()
                   .And(traceId1 == traceId2)
                   .And(!(traceId1 != traceId2)));
        }
Example #3
0
 public bool Equals(ActivityContext value) => SpanId.Equals(value.SpanId) && TraceId.Equals(value.TraceId) && TraceFlags == value.TraceFlags && TraceState == value.TraceState && IsRemote == value.IsRemote;
Example #4
0
        /// <summary>
        /// Returns true if Span instances are equal
        /// </summary>
        /// <param name="other">Instance of Span to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Span other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TraceId == other.TraceId ||
                     TraceId != null &&
                     TraceId.Equals(other.TraceId)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ParentId == other.ParentId ||
                     ParentId != null &&
                     ParentId.Equals(other.ParentId)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Kind == other.Kind ||
                     Kind != null &&
                     Kind.Equals(other.Kind)
                 ) &&
                 (
                     Timestamp == other.Timestamp ||
                     Timestamp != null &&
                     Timestamp.Equals(other.Timestamp)
                 ) &&
                 (
                     Duration == other.Duration ||
                     Duration != null &&
                     Duration.Equals(other.Duration)
                 ) &&
                 (
                     Debug == other.Debug ||
                     Debug != null &&
                     Debug.Equals(other.Debug)
                 ) &&
                 (
                     Shared == other.Shared ||
                     Shared != null &&
                     Shared.Equals(other.Shared)
                 ) &&
                 (
                     LocalEndpoint == other.LocalEndpoint ||
                     LocalEndpoint != null &&
                     LocalEndpoint.Equals(other.LocalEndpoint)
                 ) &&
                 (
                     RemoteEndpoint == other.RemoteEndpoint ||
                     RemoteEndpoint != null &&
                     RemoteEndpoint.Equals(other.RemoteEndpoint)
                 ) &&
                 (
                     Annotations == other.Annotations ||
                     Annotations != null &&
                     Annotations.SequenceEqual(other.Annotations)
                 ) &&
                 (
                     Tags == other.Tags ||
                     Tags != null &&
                     Tags.Equals(other.Tags)
                 ));
        }