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()); }
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); }
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); }