Пример #1
0
 public ActivityImpl(
     ITimelinePostprocessorOutput beginOwner,
     ITimelinePostprocessorOutput endOwner,
     TimeSpan begin, TimeSpan end,
     string displayName, string activityMatchingId,
     ActivityType type,
     object beginTrigger, object endTrigger,
     IEnumerable <ActivityMilestone> detachedMilestones,
     IEnumerable <ActivityPhase> detachedPhases,
     IEnumerable <string> tags)
 {
     this.beginOwner         = beginOwner;
     this.endOwner           = endOwner;
     this.begin              = begin;
     this.end                = end;
     this.displayName        = displayName;
     this.activityMatchingId = activityMatchingId;
     this.type               = type;
     this.beginTrigger       = beginTrigger;
     this.endTrigger         = endTrigger;
     this.milestones         = detachedMilestones.Select(
         ms => new ActivityMilestone(this, ms.Owner, ms.Time, ms.DisplayName, ms.Trigger)).ToList().AsReadOnly();
     this.phases = detachedPhases.Select(
         ph => new ActivityPhase(this, ph.Owner, ph.Begin, ph.End, ph.Type, ph.DisplayName)).ToList().AsReadOnly();
     this.tags = new HashSet <string>(tags);
 }
Пример #2
0
 public ActivityMilestone(IActivity a, ITimelinePostprocessorOutput owner, TimeSpan t, string displayName, object trigger)
 {
     Activity    = a;
     Owner       = owner;
     Time        = t;
     DisplayName = displayName;
     Trigger     = trigger;
 }
Пример #3
0
 public EventImpl(ITimelinePostprocessorOutput owner, TimeSpan time, string name, EventType type, object trigger)
 {
     this.owner   = owner;
     this.time    = time;
     this.name    = name;
     this.type    = type;
     this.trigger = trigger;
 }
Пример #4
0
 public ActivityPhaseInfo(IActivity a, ITimelinePostprocessorOutput owner,
                          TimeSpan b, TimeSpan e, int type, string displayName)
 {
     Activity    = a;
     Owner       = owner;
     Begin       = b;
     End         = e;
     Type        = type;
     DisplayName = displayName;
 }
Пример #5
0
 public void AddEvents(ITimelinePostprocessorOutput postprocessorOutput, IEnumerable <Event> events, bool isLastEventsSet)
 {
     this.currentPostprocessorOutput = postprocessorOutput;
     this.currentIsLastEventsSet     = isLastEventsSet;
     this.currentTimeOffsets         = postprocessorOutput.LogSource.TimeOffsets;
     foreach (var e in events)
     {
         e.Visit(this);
     }
     this.currentPostprocessorOutput = null;
     this.currentTimeOffsets         = null;
     this.currentIsLastEventsSet     = false;
 }
Пример #6
0
        void YieldActivity(StartedActivity startedActivity, EventInfo endEvtInfo, ITimelinePostprocessorOutput endOwner, bool allowTakingEndsDisplayName)
        {
            var begin = startedActivity.begin;

            activities.Add(new ActivityImpl(
                               startedActivity.beginOwner,
                               endOwner,
                               begin.timestamp - origin,
                               endEvtInfo.timestamp - origin,
                               (startedActivity.type == ActivityType.Lifespan && allowTakingEndsDisplayName && endEvtInfo.evt.DisplayName.Length > begin.evt.DisplayName.Length) ?
                               endEvtInfo.evt.DisplayName :          // for lifespans get End's display name because it may be more specific than Begin's one
                               begin.evt.DisplayName,
                               startedActivity.activityMatchingId,
                               startedActivity.type,
                               begin.evt.Trigger,
                               endEvtInfo.evt.Trigger,
                               startedActivity.milestones,
                               startedActivity.begin.evt.Tags.Concat(endEvtInfo.evt.Tags)
                               ));
        }
Пример #7
0
        void YieldActivity(StartedActivity startedActivity, EventInfo endEvtInfo, ITimelinePostprocessorOutput endOwner, bool isEndedForcefully)
        {
            var begin = startedActivity.begin;

            activities.Add(new ActivityImpl(
                               startedActivity.beginOwner,
                               endOwner,
                               begin.timestamp - origin,
                               endEvtInfo.timestamp - origin,
                               (startedActivity.type == ActivityType.Lifespan && !isEndedForcefully && endEvtInfo.evt.DisplayName.Length > begin.evt.DisplayName.Length) ?
                               endEvtInfo.evt.DisplayName :          // for lifespans get End's display name because it may be more specific than Begin's one
                               begin.evt.DisplayName,
                               startedActivity.activityMatchingId,
                               startedActivity.type,
                               begin.evt.Trigger,
                               endEvtInfo.evt.Trigger,
                               startedActivity.milestones,
                               startedActivity.phases,
                               startedActivity.begin.evt.Tags.Concat(endEvtInfo.evt.Tags),
                               isError: startedActivity.status == ActivityStatus.Error,
                               isEndedForcefully: isEndedForcefully
                               ));
        }