コード例 #1
0
        async Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var inputMultiplexed = input.Multiplex();

            ICombinedParser parser = postprocessing.TimeSeries.CreateParser();

            var feedNativeEvents = parser.FeedLogMessages(inputMultiplexed);

            var extensionSources = pluginModel.ChromeDebugTimeSeriesSources.Select(
                src => src(inputMultiplexed, parser)).ToList();
            var tasks = extensionSources.Select(s => s.Task).ToList();

            tasks.Add(feedNativeEvents);
            tasks.AddRange(extensionSources.SelectMany(s => s.MultiplexingEnumerables.Select(e => e.Open())));
            tasks.Add(inputMultiplexed.Open());

            await Task.WhenAll(tasks);

            foreach (var ts in parser.GetParsedTimeSeries())
            {
                ts.DataPoints = Postprocessing.TimeSeries.Filters.RemoveRepeatedValues.Filter(ts.DataPoints).ToList();
            }

            await postprocessing.TimeSeries.SavePostprocessorOutput(parser, postprocessorInput);
        }
コード例 #2
0
        async Task RunForWiresharkDpmlMessages(
            IEnumerableAsync <Pdml.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var logMessages = input.Multiplex();

            Pdml.ITimelineEvents networkEvents = new Pdml.TimelineEvents();
            var endOfTimelineEventSource       = postprocessing.Timeline.CreateEndOfTimelineEventSource <Pdml.Message>();

            var networkEvts = networkEvents.GetEvents(logMessages);
            var eofEvts     = endOfTimelineEventSource.GetEvents(logMessages);

            var events = EnumerableAsync.Merge(
                networkEvts,
                eofEvts
                );

            var serialize = postprocessing.Timeline.CreatePostprocessorOutputBuilder()
                            .SetEvents(events)
                            .SetTriggersConverter(evtTrigger => TextLogEventTrigger.Make((Pdml.Message)evtTrigger))
                            .Build(postprocessorInput);

            await Task.WhenAll(serialize, logMessages.Open());
        }
        async Task RunForSpringServiceLog(
            IEnumerableAsync <SVC.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var inputMultiplexed = input.Multiplex();

            var messagingEventsSource = postprocessing.Timeline.CreateMessagingEventsSource();
            var messagingEvents       = messagingEventsSource.GetEvents(
                ((SVC.IMessagingEvents) new SVC.MessagingEvents()).GetEvents(inputMultiplexed));
            var eofEvents = postprocessing.Timeline.CreateEndOfTimelineEventSource <SVC.Message>()
                            .GetEvents(inputMultiplexed);

            var events = EnumerableAsync.Merge(
                messagingEvents,
                eofEvents
                );

            var serialize = postprocessing.Timeline.CreatePostprocessorOutputBuilder()
                            .SetEvents(events)
                            .SetTriggersConverter(evtTrigger => TextLogEventTrigger.Make((SVC.Message)evtTrigger))
                            .Build(postprocessorInput);

            await Task.WhenAll(serialize, inputMultiplexed.Open());
        }
コード例 #4
0
        async Task RunForChromeDebug(
            IEnumerableAsync <ChromeDebugLog.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var multiplexedInput = input.Multiplex();
            var matcher          = postprocessing.CreatePrefixMatcher();

            var extensionSources = pluginModel.ChromeDebugLogMessagingEventSources.Select(src => src(
                                                                                              matcher, multiplexedInput, postprocessorInput.TemplatesTracker)).ToArray();

            var events = EnumerableAsync.Merge(extensionSources.Select(s => s.Events).ToArray());

            var serialize = postprocessing.SequenceDiagram.CreatePostprocessorOutputBuilder()
                            .SetMessagingEvents(events)
                            .SetTriggersConverter(evtTrigger => TextLogEventTrigger.FromUnknownTrigger(evtTrigger))
                            .Build(postprocessorInput);

            var tasks = new List <Task>();

            tasks.Add(serialize);
            tasks.AddRange(extensionSources.SelectMany(s => s.MultiplexingEnumerables.Select(e => e.Open())));
            tasks.Add(multiplexedInput.Open());
            await Task.WhenAll(tasks);
        }
        async Task RunForSymLog(
            IEnumerableAsync <Sym.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            IPrefixMatcher matcher                  = postprocessing.CreatePrefixMatcher();
            var            inputMultiplexed         = input.Multiplex();
            var            symEvents                = RunForSymMessages(matcher, inputMultiplexed, postprocessorInput.TemplatesTracker, out var symLog);
            var            endOfTimelineEventSource = postprocessing.Timeline.CreateEndOfTimelineEventSource <Sym.Message>();
            var            messagingEventsSource    = postprocessing.Timeline.CreateMessagingEventsSource();
            var            messagingEvents          = messagingEventsSource.GetEvents(
                ((Sym.IMessagingEvents) new Sym.MessagingEvents()).GetEvents(inputMultiplexed));
            var eofEvts = endOfTimelineEventSource.GetEvents(inputMultiplexed);

            matcher.Freeze();

            var events = EnumerableAsync.Merge(
                symEvents,
                messagingEvents,
                eofEvts
                );

            var serialize = postprocessing.Timeline.CreatePostprocessorOutputBuilder()
                            .SetEvents(events)
                            .SetTriggersConverter(evtTrigger => TextLogEventTrigger.Make((Sym.Message)evtTrigger))
                            .Build(postprocessorInput);

            await Task.WhenAll(serialize, symLog.Open(), inputMultiplexed.Open());
        }
コード例 #6
0
        async Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> input,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var            multiplexedInput = input.Multiplex();
            IPrefixMatcher matcher          = postprocessing.CreatePrefixMatcher();

            var extensionSources = pluginModel.ChromeDebugLogTimeLineEventSources.Select(src => src(
                                                                                             matcher, multiplexedInput, postprocessorInput.TemplatesTracker)).ToArray();

            var events = postprocessorInput.TemplatesTracker.TrackTemplates(EnumerableAsync.Merge(extensionSources.Select(s => s.Events).ToArray()));

            matcher.Freeze();

            var serialize = postprocessing.Timeline.SavePostprocessorOutput(
                events,
                null,
                evtTrigger => TextLogEventTrigger.FromUnknownTrigger(evtTrigger),
                postprocessorInput
                );

            var tasks = new List <Task>();

            tasks.Add(serialize);
            tasks.AddRange(extensionSources.SelectMany(s => s.MultiplexingEnumerables.Select(e => e.Open())));
            tasks.Add(multiplexedInput.Open());
            await Task.WhenAll(tasks);
        }
コード例 #7
0
        async static Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            var            multiplexedInput = input.Multiplex();
            IPrefixMatcher matcher          = new PrefixMatcher();
            var            logMessages      = CDL.Helpers.MatchPrefixes(multiplexedInput, matcher).Multiplex();

            Sym.IMeetingsStateInspector symMeetingsStateInsector = new Sym.MeetingsStateInspector(matcher);

            var symLog = Sym.Helpers.MatchPrefixes((new Sym.Reader()).FromChromeDebugLog(multiplexedInput), matcher).Multiplex();
            var symMeetingStateEvents = symMeetingsStateInsector.GetEvents(symLog);

            var symMeetingEvents = (new InspectedObjectsLifetimeEventsSource(e =>
                                                                             e.ObjectType == Sym.MeetingsStateInspector.MeetingTypeInfo ||
                                                                             e.ObjectType == Sym.MeetingsStateInspector.MeetingSessionTypeInfo
                                                                             )).GetEvents(symMeetingStateEvents);

            matcher.Freeze();

            var events = EnumerableAsync.Merge(
                symMeetingEvents
                )
                         .ToFlatList();

            await Task.WhenAll(events, symLog.Open(), /*logMessages.Open(),*/ multiplexedInput.Open());

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

            if (templatesTracker != null)
            {
                (await events).ForEach(e => templatesTracker.RegisterUsage(e.TemplateId));
            }

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await events,
                null,
                evtTrigger => TextLogEventTrigger.Make((Sym.Message)evtTrigger),
                contentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }
コード例 #8
0
        async static Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            var inputMultiplexed = input.Multiplex();

            IPrefixMatcher matcher     = new PrefixMatcher();
            var            logMessages = CDL.Helpers.MatchPrefixes(inputMultiplexed, matcher).Multiplex();

            CDL.IWebRtcStateInspector webRtcStateInspector = new CDL.WebRtcStateInspector(matcher);

            var webRtcEvts = webRtcStateInspector.GetEvents(logMessages);

            Sym.IMeetingsStateInspector symMeetingsStateInspector = new Sym.MeetingsStateInspector(matcher);
            Sym.IMediaStateInspector    symMediaStateInspector    = new Sym.MediaStateInspector(matcher);
            var symMessages = Sym.Helpers.MatchPrefixes((new Sym.Reader()).FromChromeDebugLog(inputMultiplexed), matcher).Multiplex();

            var symMeetingEvents = symMeetingsStateInspector.GetEvents(symMessages);
            var symMediaEvents   = symMediaStateInspector.GetEvents(symMessages);

            matcher.Freeze();

            var events = EnumerableAsync.Merge(
                webRtcEvts.Select(ConvertTriggers <CDL.Message>),
                symMeetingEvents.Select(ConvertTriggers <Sym.Message>),
                symMediaEvents.Select(ConvertTriggers <Sym.Message>)
                )
                         .ToFlatList();

            await Task.WhenAll(events, symMessages.Open(), logMessages.Open(), inputMultiplexed.Open());

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

            if (templatesTracker != null)
            {
                (await events).ForEach(e => templatesTracker.RegisterUsage(e.TemplateId));
            }

            StateInspectorOutput.SerializePostprocessorOutput(await events, null, contentsEtagAttr).Save(outputFileName);
        }
コード例 #9
0
        async Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> inputMessages,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            var inputMultiplexed = inputMessages.Multiplex();

            IPrefixMatcher matcher     = postprocessing.CreatePrefixMatcher();
            var            logMessages = inputMultiplexed.MatchTextPrefixes(matcher).Multiplex();

            CDL.IWebRtcStateInspector webRtcStateInspector = new CDL.WebRtcStateInspector(matcher);

            var webRtcEvts = webRtcStateInspector.GetEvents(logMessages);

            var extensionSources = pluginModel
                                   .ChromeDebugStateEventSources.Select(
                source => source(matcher, inputMultiplexed, postprocessorInput.TemplatesTracker)
                )
                                   .ToArray();

            var eventSources = new List <IEnumerableAsync <Event[]> >
            {
                webRtcEvts
            };

            eventSources.AddRange(extensionSources.Select(s => s.Events));

            matcher.Freeze();

            var events = postprocessorInput.TemplatesTracker.TrackTemplates(EnumerableAsync.Merge(eventSources.ToArray()));

            var serialize = postprocessing.StateInspector.SavePostprocessorOutput(
                events,
                null,
                evtTrigger => TextLogEventTrigger.FromUnknownTrigger(evtTrigger),
                postprocessorInput
                );

            var tasks = new List <Task>();

            tasks.Add(serialize);
            tasks.AddRange(extensionSources.SelectMany(s => s.MultiplexingEnumerables.Select(e => e.Open())));
            tasks.Add(logMessages.Open());
            tasks.Add(inputMultiplexed.Open());
            await Task.WhenAll(tasks);
        }
コード例 #10
0
        async static Task RunForChromeDebug(
            IEnumerableAsync <CDL.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            var            multiplexedInput = input.Multiplex();
            IPrefixMatcher matcher          = new PrefixMatcher();
            // var logMessages = CDL.Helpers.MatchPrefixes(multiplexedInput, matcher);

            var events = RunForSymMessages(
                matcher,
                (new Sym.Reader()).FromChromeDebugLog(multiplexedInput)
                );

            matcher.Freeze();

            await Task.WhenAll(events, multiplexedInput.Open());

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

            if (templatesTracker != null)
            {
                (await events).ForEach(e => templatesTracker.RegisterUsage(e.TemplateId));
            }

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await events,
                null,
                evtTrigger => TextLogEventTrigger.Make((Sym.Message)evtTrigger),
                contentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }