async Task RunForWebRTCDump( IEnumerableAsync <WRD.Message[]> inputMessages, LogSourcePostprocessorInput postprocessorInput ) { IPrefixMatcher matcher = postprocessing.CreatePrefixMatcher(); var logMessages = WRD.Helpers.MatchPrefixes(inputMessages, matcher).Multiplex(); WRD.IWebRtcStateInspector webRtcStateInspector = new WRD.WebRtcStateInspector(matcher); var webRtcEvts = webRtcStateInspector.GetEvents(logMessages); matcher.Freeze(); var events = postprocessorInput.TemplatesTracker.TrackTemplates(EnumerableAsync.Merge( webRtcEvts )); var serialize = postprocessing.StateInspector.SavePostprocessorOutput( events, null, evtTrigger => TextLogEventTrigger.Make((WRD.Message)evtTrigger), postprocessorInput ); await Task.WhenAll(serialize, logMessages.Open()); }
async static Task RunForWebRTCDump( IEnumerableAsync <WRD.Message[]> input, string outputFileName, CancellationToken cancellation, ICodepathTracker templatesTracker, XAttribute contentsEtagAttr ) { IPrefixMatcher matcher = new PrefixMatcher(); var logMessages = WRD.Helpers.MatchPrefixes(input, matcher).Multiplex(); WRD.IWebRtcStateInspector webRtcStateInspector = new WRD.WebRtcStateInspector(matcher); var webRtcEvts = webRtcStateInspector.GetEvents(logMessages); matcher.Freeze(); var events = EnumerableAsync.Merge( webRtcEvts ) .Select(ConvertTriggers <WRD.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); }