Beispiel #1
0
 public override bool Equals(object o)
 {
     if (o == this)
     {
         return(true);
     }
     if (o is TimedEvents <T> )
     {
         TimedEvents <T> that = (TimedEvents <T>)o;
         return((this.Events.SequenceEqual(that.Events)) &&
                (this.DroppedEventsCount == that.DroppedEventsCount));
     }
     return(false);
 }
Beispiel #2
0
        public static ISpanData Create(
            ISpanContext context,
            ISpanId parentSpanId,
            bool?hasRemoteParent,
            string name,
            ITimestamp startTimestamp,
            IAttributes attributes,
            ITimedEvents <IAnnotation> annotations,
            ITimedEvents <IMessageEvent> messageOrNetworkEvents,
            ILinks links,
            int?childSpanCount,
            Status status,
            ITimestamp endTimestamp)
        {
            if (messageOrNetworkEvents == null)
            {
                throw new ArgumentNullException(nameof(messageOrNetworkEvents));
            }

            IList <ITimedEvent <IMessageEvent> > messageEventsList = new List <ITimedEvent <IMessageEvent> >();

            foreach (ITimedEvent <IMessageEvent> timedEvent in messageOrNetworkEvents.Events)
            {
                messageEventsList.Add(timedEvent);
            }

            ITimedEvents <IMessageEvent> messageEvents = TimedEvents <IMessageEvent> .Create(messageEventsList, messageOrNetworkEvents.DroppedEventsCount);

            return(new SpanData(
                       context,
                       parentSpanId,
                       hasRemoteParent,
                       name,
                       startTimestamp,
                       attributes,
                       annotations,
                       messageEvents,
                       links,
                       childSpanCount,
                       status,
                       endTimestamp));
        }