async static Task RunForSymLog(
            IEnumerableAsync <Sym.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            IPrefixMatcher matcher = new PrefixMatcher();
            var            events  = RunForSymMessages(matcher, input);

            matcher.Freeze();

            await events;

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await events,
                null,
                evtTrigger => TextLogEventTrigger.Make((Sym.Message)evtTrigger),
                contentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }
        async static Task RunForHttpArchive(
            IEnumerableAsync <HAR.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            HAR.ITimelineEvents timelineEvents = new HAR.TimelineEvents();

            var events = EnumerableAsync.Merge(
                timelineEvents.GetEvents(input)
                )
                         .ToFlatList();

            await events;

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

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

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await events,
                null,
                evtTrigger => TextLogEventTrigger.Make((HAR.Message)evtTrigger),
                contentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }
Example #3
0
        static async Task RunTimelinePostprocessor(LogSourcePostprocessorInput input)
        {
            string outputFileName = input.OutputFileName;
            var    logProducer    = LJT.Extensions.Read(new LJT.Reader(), input.LogFileName,
                                                        null, input.ProgressHandler).Multiplex();

            var profilingEvents = (new LJT.ProfilingTimelineEventsSource()).GetEvents(logProducer);

            var lister = EnumerableAsync.Merge(
                profilingEvents
                ).ToList();

            Task[] leafs = new Task[]
            {
                lister,
                logProducer.Open(),
            };
            await Task.WhenAll(leafs);

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await lister,
                null,
                evtTrigger => TextLogEventTrigger.Make((LJT.Message)evtTrigger),
                input.InputContentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }
Example #4
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);
        }
        async static Task RunForChromeDriver(
            IEnumerableAsync <CD.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            IPrefixMatcher matcher     = new PrefixMatcher();
            var            logMessages = CD.Helpers.MatchPrefixes(input, matcher).Multiplex();

            CD.ITimelineEvents networkEvents = new CD.TimelineEvents(matcher);

            var networkEvts = networkEvents.GetEvents(logMessages);

            matcher.Freeze();

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

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

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

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

            TimelinePostprocessorOutput.SerializePostprocessorOutput(
                await events,
                null,
                evtTrigger => TextLogEventTrigger.Make((CD.Message)evtTrigger),
                contentsEtagAttr
                ).SaveToFileOrToStdOut(outputFileName);
        }
        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);
        }