예제 #1
0
        public TimelinePostprocessorOutput(LogSourcePostprocessorDeserializationParams p, IEntitiesComparer entitiesComparer, ILogPartTokenFactory rotatedLogPartFactory)
        {
            this.logSource = p.LogSource;

            if (!p.Reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(p.Reader);

            var eventsDeserializer = new EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
            var events             = new List <Event>();

            foreach (var elt in p.Reader.ReadChildrenElements())
            {
                if (eventsDeserializer.TryDeserialize(elt, out var evt))
                {
                    events.Add(evt);
                }
                else if (rotatedLogPartFactory.TryReadLogPartToken(elt, out var tmp))
                {
                    this.rotatedLogPartToken = tmp;
                }
                p.Cancellation.ThrowIfCancellationRequested();
            }
            this.timelineEvents = events.AsReadOnly();
        }
예제 #2
0
        public StateInspectorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactories rotatedLogPartFactories)
        {
            this.logSource = p.LogSource;

            if (!p.Reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(p.Reader);

            var eventsDeserializer = new EventsDeserializer(TextLogEventTrigger.DeserializerFunction);

            foreach (var elt in p.Reader.ReadChildrenElements())
            {
                if (eventsDeserializer.TryDeserialize(elt, out var evt))
                {
                    events.Add(evt);
                }
                else if (rotatedLogPartFactories.TryReadLogPartToken(elt, out var tmp))
                {
                    this.rotatedLogPartToken = tmp;
                }
                p.Cancellation.ThrowIfCancellationRequested();
            }
        }
예제 #3
0
 public TimeSeriesPostprocessorOutput(LogSourcePostprocessorDeserializationParams p,
                                      ILogPartTokenFactory rotatedLogPartFactory, TSBlocks.ITimeSeriesTypesAccess timeSeriesTypesAccess)
 {
     this.logSource = p.LogSource;
     logDisplayName = logSource.DisplayName;
     p.Reader.ReadStartElement();
     events     = (List <TSBlocks.EventBase>)timeSeriesTypesAccess.GetEventsSerializer().Deserialize(p.Reader);
     timeSeries = (List <TSBlocks.TimeSeriesData>)timeSeriesTypesAccess.GetSeriesSerializer().Deserialize(p.Reader);
     timeSeries.ForEach(Sanitize);
 }
예제 #4
0
        public SequenceDiagramPostprocessorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactory rotatedLogPartFactory)
        {
            this.logSource = p.LogSource;
            var reader = p.Reader;

            events              = new List <M.Event>();
            timelineComments    = new List <TLBlock.Event>();
            stateComments       = new List <SIBlock.Event>();
            rotatedLogPartToken = new NullLogPartToken();

            if (!reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(reader);

            if (reader.ReadToFollowing(messagingEventsElementName))
            {
                var eventsDeserializer = new M.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        events.Add(evt);
                    }
                }
            }
            if (reader.ReadToFollowing(timelineCommentsElementName))
            {
                var eventsDeserializer = new TLBlock.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        timelineComments.Add(evt);
                    }
                }
            }
            if (reader.ReadToFollowing(stateCommentsElementName))
            {
                var eventsDeserializer = new SIBlock.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                foreach (var elt in reader.ReadChildrenElements())
                {
                    if (eventsDeserializer.TryDeserialize(elt, out var evt))
                    {
                        stateComments.Add(evt);
                    }
                }
            }
        }
예제 #5
0
        public PostprocessorOutput(
            LogSourcePostprocessorDeserializationParams p,
            ILogPartTokenFactories rotatedLogPartFactories,
            ISameNodeDetectionTokenFactories nodeDetectionTokenFactories)
        {
            this.logSource = p.LogSource;
            var reader = p.Reader;

            events = new List <M.Event>();
            rotatedLogPartToken    = new NullLogPartToken();
            sameNodeDetectionToken = new NullSameNodeDetectionToken();

            if (!reader.ReadToFollowing("root"))
            {
                throw new FormatException();
            }
            etag.Read(reader);

            foreach (var elt in p.Reader.ReadChildrenElements())
            {
                if (rotatedLogPartFactories.TryReadLogPartToken(elt, out var tmp))
                {
                    this.rotatedLogPartToken = tmp;
                }
                else if (nodeDetectionTokenFactories.TryReadLogPartToken(elt, out var tmp2))
                {
                    sameNodeDetectionToken = tmp2;
                }
                else if (elt.Name == messagingEventsElementName)
                {
                    var eventsDeserializer = new M.EventsDeserializer(TextLogEventTrigger.DeserializerFunction);
                    foreach (var me in elt.Elements())
                    {
                        if (eventsDeserializer.TryDeserialize(me, out var evt))
                        {
                            events.Add(evt);
                        }
                    }
                }
                p.Cancellation.ThrowIfCancellationRequested();
            }
        }
예제 #6
0
        public object Deserialize(PostprocessorKind kind, LogSourcePostprocessorDeserializationParams p)
        {
            switch (kind)
            {
            case PostprocessorKind.StateInspector:
                return(new StateInspector.StateInspectorOutput(p, logPartTokenFactories));

            case PostprocessorKind.Timeline:
                return(new Timeline.TimelinePostprocessorOutput(p, logPartTokenFactories));

            case PostprocessorKind.SequenceDiagram:
                return(new SequenceDiagram.SequenceDiagramPostprocessorOutput(p, null));

            case PostprocessorKind.TimeSeries:
                return(new TimeSeries.TimeSeriesPostprocessorOutput(p, null, timeSeriesTypesAccess));

            case PostprocessorKind.Correlator:
                return(new Correlation.PostprocessorOutput(p, logPartTokenFactories, nodeDetectionTokenFactories));

            default:
                return(null);
            }
        }
예제 #7
0
        public object Deserialize(PostprocessorKind kind, LogSourcePostprocessorDeserializationParams p)
        {
            switch (kind)
            {
            case PostprocessorKind.StateInspector:
                return(new StateInspector.StateInspectorOutput(p));

            case PostprocessorKind.Timeline:
                return(new Timeline.TimelinePostprocessorOutput(p, null));

            case PostprocessorKind.SequenceDiagram:
                return(new SequenceDiagram.SequenceDiagramPostprocessorOutput(p, null));

            case PostprocessorKind.TimeSeries:
                return(new TimeSeries.TimeSeriesPostprocessorOutput(p, null, timeSeriesTypesAccess));

            case PostprocessorKind.Correlator:
                return(Correlation.CorrelatorPostprocessorOutput.Parse(p.Reader));

            default:
                return(null);
            }
        }
 public TimelinePostprocessorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactories logPartTokenFactories) :
     this(p, TimelineEntitiesComparer.Instance, logPartTokenFactories)
 {
 }
예제 #9
0
 public TimelinePostprocessorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactory rotatedLogPartFactory = null) :
     this(p, TimelineEntitiesComparer.Instance, rotatedLogPartFactory)
 {
 }