private static async Task <List <Event> > RunForSymMessages(
            IPrefixMatcher matcher,
            IEnumerableAsync <Sym.Message[]> messages
            )
        {
            Sym.IMeetingsStateInspector symMeetingsStateInsector = new Sym.MeetingsStateInspector(matcher);
            Sym.IMediaStateInspector    symMediaStateInsector    = new Sym.MediaStateInspector(matcher);
            Sym.ITimelineEvents         symTimelineEvents        = new Sym.TimelineEvents(matcher);

            var symLog = Sym.Helpers.MatchPrefixes(messages, matcher).Multiplex();
            var symMeetingStateEvents = symMeetingsStateInsector.GetEvents(symLog);
            var symMediaStateEvents   = symMediaStateInsector.GetEvents(symLog);

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

            var symMediaEvents = (new InspectedObjectsLifetimeEventsSource(e =>
                                                                           e.ObjectType == Sym.MediaStateInspector.LocalScreenTypeInfo ||
                                                                           e.ObjectType == Sym.MediaStateInspector.LocalAudioTypeInfo ||
                                                                           e.ObjectType == Sym.MediaStateInspector.LocalVideoTypeInfo
                                                                           )).GetEvents(symMediaStateEvents);

            var events = EnumerableAsync.Merge(
                symMeetingEvents,
                symMediaEvents,
                symTimelineEvents.GetEvents(symLog)
                ).ToFlatList();

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

            return(events.Result);
        }
        async Task RunForSymRTC(
            IEnumerableAsync <Sym.Message[]> messages,
            LogSourcePostprocessorInput postprocessorInput
            )
        {
            IPrefixMatcher matcher     = postprocessing.CreatePrefixMatcher();
            var            logMessages = messages.MatchTextPrefixes(matcher).Multiplex();

            Sym.IMeetingsStateInspector symMeetingsStateInspector = new Sym.MeetingsStateInspector(matcher);
            Sym.IMediaStateInspector    symMediaStateInspector    = new Sym.MediaStateInspector(matcher, symMeetingsStateInspector);

            var symMeetingEvents = symMeetingsStateInspector.GetEvents(logMessages);
            var symMediagEvents  = symMediaStateInspector.GetEvents(logMessages);

            matcher.Freeze();

            var events = postprocessorInput.TemplatesTracker.TrackTemplates(EnumerableAsync.Merge(
                                                                                symMeetingEvents,
                                                                                symMediagEvents
                                                                                ));

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

            await Task.WhenAll(serialize, logMessages.Open());
        }
Пример #3
0
        async static Task RunForSymRTC(
            IEnumerableAsync <Sym.Message[]> input,
            string outputFileName,
            CancellationToken cancellation,
            ICodepathTracker templatesTracker,
            XAttribute contentsEtagAttr
            )
        {
            IPrefixMatcher matcher     = new PrefixMatcher();
            var            logMessages = Sym.Helpers.MatchPrefixes(input, matcher).Multiplex();

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

            var symMeetingEvents = symMeetingsStateInspector.GetEvents(logMessages);

            matcher.Freeze();

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

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

            if (cancellation.IsCancellationRequested)
            {
                return;
            }

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

            StateInspectorOutput.SerializePostprocessorOutput(await events, null, contentsEtagAttr).Save(outputFileName);
        }
Пример #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);
        }
        Chromium.EventsSource <Event, Chromium.ChromeDebugLog.Message> .Factory IPostprocessorsFactory.CreateChromeDebugSourceFactory()
        {
            return((matcher, inputMultiplexed, tracker) =>
            {
                Sym.IMeetingsStateInspector symMeetingsStateInspector = new Sym.MeetingsStateInspector(matcher);
                Sym.IMediaStateInspector symMediaStateInspector = new Sym.MediaStateInspector(matcher, symMeetingsStateInspector);
                var symMessages =
                    (new Sym.Reader(postprocessing.TextLogParser, CancellationToken.None).FromChromeDebugLog(inputMultiplexed)).MatchTextPrefixes(matcher)
                    .Multiplex();

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

                return new Chromium.EventsSource <Event, Chromium.ChromeDebugLog.Message>(
                    EnumerableAsync.Merge(symMeetingEvents, symMediaEvents),
                    symMessages
                    );
            });
        }
        private IEnumerableAsync <Event[]> RunForSymMessages(
            IPrefixMatcher matcher,
            IEnumerableAsync <Sym.Message[]> messages,
            ICodepathTracker templatesTracker,
            out IMultiplexingEnumerable <MessagePrefixesPair <Sym.Message>[]> symLog
            )
        {
            Sym.IMeetingsStateInspector symMeetingsStateInspector = new Sym.MeetingsStateInspector(matcher);
            Sym.IMediaStateInspector    symMediaStateInsector     = new Sym.MediaStateInspector(matcher, symMeetingsStateInspector);
            Sym.ITimelineEvents         symTimelineEvents         = new Sym.TimelineEvents(matcher);
            Sym.Diag.ITimelineEvents    diagTimelineEvents        = new Sym.Diag.TimelineEvents(matcher);

            symLog = messages.MatchTextPrefixes(matcher).Multiplex();
            var symMeetingStateEvents = symMeetingsStateInspector.GetEvents(symLog);
            var symMediaStateEvents   = symMediaStateInsector.GetEvents(symLog);

            var symMeetingEvents = postprocessing.Timeline.CreateInspectedObjectsLifetimeEventsSource(e =>
                                                                                                      e.ObjectType == Sym.MeetingsStateInspector.MeetingTypeInfo ||
                                                                                                      e.ObjectType == Sym.MeetingsStateInspector.MeetingSessionTypeInfo ||
                                                                                                      e.ObjectType == Sym.MeetingsStateInspector.MeetingRemoteParticipantTypeInfo ||
                                                                                                      e.ObjectType == Sym.MeetingsStateInspector.ProbeSessionTypeInfo ||
                                                                                                      e.ObjectType == Sym.MeetingsStateInspector.InvitationTypeInfo
                                                                                                      ).GetEvents(symMeetingStateEvents);

            var symMediaEvents = postprocessing.Timeline.CreateInspectedObjectsLifetimeEventsSource(e =>
                                                                                                    e.ObjectType == Sym.MediaStateInspector.LocalScreenTypeInfo ||
                                                                                                    e.ObjectType == Sym.MediaStateInspector.LocalAudioTypeInfo ||
                                                                                                    e.ObjectType == Sym.MediaStateInspector.LocalVideoTypeInfo ||
                                                                                                    e.ObjectType == Sym.MediaStateInspector.TestSessionTypeInfo
                                                                                                    ).GetEvents(symMediaStateEvents);

            var events = templatesTracker.TrackTemplates(EnumerableAsync.Merge(
                                                             symMeetingEvents,
                                                             symMediaEvents,
                                                             symTimelineEvents.GetEvents(symLog),
                                                             diagTimelineEvents.GetEvents(symLog)
                                                             ));

            return(events);
        }