Ejemplo n.º 1
0
        public PostprocessorsManager(
            ILogSourcesManager logSources,
            Telemetry.ITelemetryCollector telemetry,
            ISynchronizationContext modelSyncContext,
            ISynchronizationContext threadPoolSyncContext,
            IHeartBeatTimer heartbeat,
            Progress.IProgressAggregator progressAggregator,
            Settings.IGlobalSettingsAccessor settingsAccessor,
            IOutputDataDeserializer outputDataDeserializer,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.logSources             = logSources;
            this.telemetry              = telemetry;
            this.progressAggregator     = progressAggregator;
            this.settingsAccessor       = settingsAccessor;
            this.modelSyncContext       = modelSyncContext;
            this.threadPoolSyncContext  = threadPoolSyncContext;
            this.heartbeat              = heartbeat;
            this.outputDataDeserializer = outputDataDeserializer;
            this.tracer  = traceSourceFactory.CreateTraceSource("App", "ppm");
            this.updater = new AsyncInvokeHelper(modelSyncContext, Refresh);

            logSources.OnLogSourceAdded             += (sender, args) => updater.Invoke();
            logSources.OnLogSourceRemoved           += (sender, args) => updater.Invoke();
            logSources.OnLogSourceAnnotationChanged += (sender, args) => updater.Invoke();
            logSources.OnLogSourceStatsChanged      += (object sender, LogSourceStatsEventArgs e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.ContentsEtag) != 0)
                {
                    updater.Invoke();
                }
            };
            Refresh();
        }
Ejemplo n.º 2
0
        public void BeforeEach()
        {
            logSources         = Substitute.For <ILogSourcesManager>();
            telemetry          = Substitute.For <Telemetry.ITelemetryCollector>();
            mockedSyncContext  = new ManualSynchronizationContext();
            heartbeat          = Substitute.For <IHeartBeatTimer>();
            progressAggregator = Substitute.For <Progress.IProgressAggregator>();
            settingsAccessor   = Substitute.For <Settings.IGlobalSettingsAccessor>();
            logSource1         = Substitute.For <ILogSource>();
            logProviderFac1    = Substitute.For <ILogProviderFactory>();
            logSource1.Provider.Factory.Returns(logProviderFac1);
            logSource1.Provider.ConnectionParams.Returns(new ConnectionParams($"{ConnectionParamsKeys.PathConnectionParam}=/log.txt"));
            logSource1.Provider.Stats.Returns(new LogProviderStats()
            {
                ContentsEtag = null
            });
            logSourcePP1 = Substitute.For <ILogSourcePostprocessor>();
            logSourcePP1.Kind.Returns(PostprocessorKind.SequenceDiagram);
            pp1outputXmlSection = Substitute.For <Persistence.ISaxXMLStorageSection>();
            logSource1.LogSourceSpecificStorageEntry.OpenSaxXMLSection("postproc-sequencediagram.xml", Persistence.StorageSectionOpenFlag.ReadOnly).Returns(pp1outputXmlSection);
            pp1outputXmlSection.Reader.Returns(Substitute.For <XmlReader>());
            pp1PostprocessorOutput = Substitute.For <IPostprocessorOutputETag>();
            outputDataDeserializer = Substitute.For <IOutputDataDeserializer>();
            outputDataDeserializer.Deserialize(PostprocessorKind.SequenceDiagram, Arg.Any <LogSourcePostprocessorDeserializationParams>()).Returns(pp1PostprocessorOutput);
            pp1RunSummary = Substitute.For <IPostprocessorRunSummary>();
            logSourcePP1.Run(null).ReturnsForAnyArgs(Task.FromResult(pp1RunSummary));
            pp1RunSummary.GetLogSpecificSummary(null).ReturnsForAnyArgs((IPostprocessorRunSummary)null);

            manager = new LogJoint.Postprocessing.PostprocessorsManager(
                logSources, telemetry, mockedSyncContext, mockedSyncContext, heartbeat, progressAggregator, settingsAccessor, outputDataDeserializer, new TraceSourceFactory());

            manager.RegisterLogType(new LogSourceMetadata(logProviderFac1, logSourcePP1));
        }
Ejemplo n.º 3
0
        public LogSource(ILogSourcesManagerInternal owner, int id,
                         ILogProviderFactory providerFactory, IConnectionParams connectionParams,
                         IModelThreads threads, ITempFilesManager tempFilesManager, Persistence.IStorageManager storageManager,
                         IInvokeSynchronization invoker, Settings.IGlobalSettingsAccessor globalSettingsAccess, IBookmarks bookmarks)
        {
            this.owner                = owner;
            this.tracer               = new LJTraceSource("LogSource", string.Format("ls{0:D2}", id));
            this.tempFilesManager     = tempFilesManager;
            this.invoker              = invoker;
            this.globalSettingsAccess = globalSettingsAccess;
            this.bookmarks            = bookmarks;

            try
            {
                this.logSourceThreads              = new LogSourceThreads(this.tracer, threads, this);
                this.timeGaps                      = new TimeGapsDetector(tracer, invoker, new LogSourceGapsSource(this));
                this.timeGaps.OnTimeGapsChanged   += timeGaps_OnTimeGapsChanged;
                this.logSourceSpecificStorageEntry = CreateLogSourceSpecificStorageEntry(providerFactory, connectionParams, storageManager);

                var extendedConnectionParams = connectionParams.Clone(true);
                this.LoadPersistedSettings(extendedConnectionParams);
                this.provider = providerFactory.CreateFromConnectionParams(this, extendedConnectionParams);
            }
            catch (Exception e)
            {
                tracer.Error(e, "Failed to initialize log source");
                ((ILogSource)this).Dispose();
                throw;
            }

            this.owner.Container.Add(this);
            this.owner.FireOnLogSourceAdded(this);

            this.LoadBookmarks();
        }
Ejemplo n.º 4
0
 public DummyModel(IModelThreads threads = null, Settings.IGlobalSettingsAccessor settings = null)
 {
     this.threads               = threads ?? new ModelThreads();
     this.dummySource           = new DummySource();
     this.hlFilters             = new FiltersList(FilterAction.Exclude, FiltersListPurpose.Highlighting);
     hlFilters.FilteringEnabled = false;
 }
Ejemplo n.º 5
0
        public Presenter(
            Settings.IGlobalSettingsAccessor settings,
            IView view,
            LogViewer.IPresenterFactory logViewerPresenterFactory)
        {
            this.view             = view;
            this.settingsAccessor = settings;

            this.sampleMessagesBaseTime   = DateTime.UtcNow;
            this.colorTable               = new AdjustingColorsGenerator(new PastelColorsGenerator(), PaletteBrightness.Normal);
            this.sampleThreads            = new ModelThreads(colorTable);
            this.dummyModel               = new LogViewer.DummyModel(threads: sampleThreads);
            this.sampleLogViewerPresenter = logViewerPresenterFactory.Create(
                dummyModel, view.PreviewLogView, createIsolatedPresenter: true);
            this.sampleLogViewerPresenter.ShowTime                 = false;
            this.sampleLogViewerPresenter.ShowRawMessages          = false;
            this.sampleLogViewerPresenter.DisabledUserInteractions =
                LogViewer.UserInteraction.FontResizing |
                LogViewer.UserInteraction.RawViewSwitching |
                LogViewer.UserInteraction.FramesNavigationMenu |
                LogViewer.UserInteraction.CopyMenu;

            this.viewFonts = view.PreviewLogView;

            this.fontSizeControl = new LabeledStepperPresenter.Presenter(view.FontSizeControlView);
            this.fontSizeControl.OnValueChanged += (sender, e) => UpdateSampleLogView(fullUpdate: false);

            view.SetPresenter(this);

            InitView();

            UpdateSampleLogView(fullUpdate: true);
        }
        public PresenterFactory(
            IHeartBeatTimer heartbeat,
            IPresentersFacade presentationFacade,
            IClipboardAccess clipboard,
            IBookmarksFactory bookmarksFactory,
            Telemetry.ITelemetryCollector telemetry,
            ILogSourcesManager logSources,
            IInvokeSynchronization modelInvoke,
            IModelThreads modelThreads,
            IFiltersList hlFilters,
            IBookmarks bookmarks,
            Settings.IGlobalSettingsAccessor settings,
            ISearchManager searchManager,
            IFiltersFactory filtersFactory
            )
        {
            this.heartbeat          = heartbeat;
            this.presentationFacade = presentationFacade;
            this.clipboard          = clipboard;
            this.bookmarksFactory   = bookmarksFactory;
            this.telemetry          = telemetry;

            this.logSources     = logSources;
            this.modelInvoke    = modelInvoke;
            this.modelThreads   = modelThreads;
            this.hlFilters      = hlFilters;
            this.bookmarks      = bookmarks;
            this.settings       = settings;
            this.searchManager  = searchManager;
            this.filtersFactory = filtersFactory;
        }
Ejemplo n.º 7
0
        public FiltersManager(
            IFiltersFactory filtersFactory,
            Settings.IGlobalSettingsAccessor globalSettingsAccessor,
            ILogSourcesManager logSourcesManager,
            IAdjustingColorsGenerator threadColors,
            IShutdown shutdown
            )
        {
            this.globalSettings = globalSettingsAccessor;
            this.logSources     = logSourcesManager;

            this.highlightFilters = filtersFactory.CreateFiltersList(FilterAction.Exclude, FiltersListPurpose.Highlighting);

            this.globalSettings.Changed += (sender, args) =>
            {
                if ((args.ChangedPieces & Settings.SettingsPiece.Appearance) != 0)
                {
                    threadColors.Brightness = globalSettings.Appearance.ColoringBrightness;
                }
            };

            this.logSources.OnLogSourceRemoved += (s, e) =>
            {
                highlightFilters.PurgeDisposedFiltersAndFiltersHavingDisposedThreads();
            };

            shutdown.Cleanup += (sender, args) =>
            {
                highlightFilters.Dispose();
            };
        }
Ejemplo n.º 8
0
        public PostprocessorsManager(
            ILogSourcesManager logSources,
            Telemetry.ITelemetryCollector telemetry,
            IInvokeSynchronization modelInvoke,
            IHeartBeatTimer heartbeat,
            Progress.IProgressAggregator progressAggregator,
            IPostprocessorsManagerUserInteractions userInteractions,
            Settings.IGlobalSettingsAccessor settingsAccessor
            )
        {
            this.userInteractions   = userInteractions;
            this.logSources         = logSources;
            this.telemetry          = telemetry;
            this.progressAggregator = progressAggregator;
            this.settingsAccessor   = settingsAccessor;

            logSources.OnLogSourceAdded             += (sender, args) => { lazyUpdateTracker.Invalidate(); };
            logSources.OnLogSourceRemoved           += (sender, args) => { lazyUpdateTracker.Invalidate(); };
            logSources.OnLogSourceAnnotationChanged += (sender, args) => { lazyUpdateTracker.Invalidate(); };
            logSources.OnLogSourceStatsChanged      += (object sender, LogSourceStatsEventArgs e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.ContentsEtag) != 0)
                {
                    modelInvoke.Invoke(() => RefreshInternal(assumeSourceChanged: sender as ILogSource));
                }
            };
            heartbeat.OnTimer += (sender, args) =>
            {
                if (lazyUpdateTracker.Validate())
                {
                    RefreshInternal();
                }
            };
            RefreshInternal();
        }
Ejemplo n.º 9
0
 public MediaBasedReaderParams(ILogSourceThreads threads, ILogMedia media, ITempFilesManager tempFilesManager, MessagesReaderFlags flags = MessagesReaderFlags.None,
                               Settings.IGlobalSettingsAccessor settingsAccessor = null)
 {
     Threads          = threads;
     Media            = media;
     Flags            = flags;
     TempFilesManager = tempFilesManager;
     SettingsAccessor = settingsAccessor ?? Settings.DefaultSettingsAccessor.Instance;
 }
Ejemplo n.º 10
0
 public MediaBasedReaderParams(ILogSourceThreadsInternal threads, ILogMedia media,
                               MessagesReaderFlags flags = MessagesReaderFlags.None,
                               Settings.IGlobalSettingsAccessor settingsAccessor = null, string parentLoggingPrefix = null)
 {
     Threads             = threads;
     Media               = media;
     Flags               = flags;
     SettingsAccessor    = settingsAccessor ?? Settings.DefaultSettingsAccessor.Instance;
     ParentLoggingPrefix = parentLoggingPrefix;
 }
Ejemplo n.º 11
0
 public MediaBasedReaderParams(ILogSourceThreadsInternal threads, ILogMedia media, ITempFilesManager tempFilesManager, ITraceSourceFactory traceSourceFactory, MessagesReaderFlags flags = MessagesReaderFlags.None,
                               Settings.IGlobalSettingsAccessor settingsAccessor = null, string parentLoggingPrefix = null)
 {
     Threads             = threads;
     Media               = media;
     Flags               = flags;
     TempFilesManager    = tempFilesManager;
     TraceSourceFactory  = traceSourceFactory;
     SettingsAccessor    = settingsAccessor ?? Settings.DefaultSettingsAccessor.Instance;
     ParentLoggingPrefix = parentLoggingPrefix;
 }
Ejemplo n.º 12
0
        public PostprocessorsManager(
            ILogSourcesManager logSources,
            Telemetry.ITelemetryCollector telemetry,
            ISynchronizationContext modelSyncContext,
            ISynchronizationContext threadPoolSyncContext,
            IHeartBeatTimer heartbeat,
            Progress.IProgressAggregator progressAggregator,
            Settings.IGlobalSettingsAccessor settingsAccessor,
            IOutputDataDeserializer outputDataDeserializer,
            ITraceSourceFactory traceSourceFactory,
            ILogPartTokenFactories logPartTokenFactories,
            Correlation.ISameNodeDetectionTokenFactories sameNodeDetectionTokenFactories,
            IChangeNotification changeNotification,
            LogMedia.IFileSystem logFileSystem
            )
        {
            this.logSources                      = logSources;
            this.telemetry                       = telemetry;
            this.progressAggregator              = progressAggregator;
            this.settingsAccessor                = settingsAccessor;
            this.modelSyncContext                = modelSyncContext;
            this.threadPoolSyncContext           = threadPoolSyncContext;
            this.heartbeat                       = heartbeat;
            this.outputDataDeserializer          = outputDataDeserializer;
            this.logPartTokenFactories           = logPartTokenFactories;
            this.sameNodeDetectionTokenFactories = sameNodeDetectionTokenFactories;
            this.changeNotification              = changeNotification;
            this.logFileSystem                   = logFileSystem;
            this.tracer  = traceSourceFactory.CreateTraceSource("App", "ppm");
            this.updater = new AsyncInvokeHelper(modelSyncContext, Refresh);

            logSources.OnLogSourceAdded             += (sender, args) => updater.Invoke();
            logSources.OnLogSourceRemoved           += (sender, args) => updater.Invoke();
            logSources.OnLogSourceAnnotationChanged += (sender, args) => updater.Invoke();
            logSources.OnLogSourceStatsChanged      += (object sender, LogSourceStatsEventArgs e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.ContentsEtag) != 0)
                {
                    updater.Invoke();
                }
            };

            this.visiblePostprocessorsOutputs = Selectors.Create(
                () => postprocessorsOutputs,
                () => logSources.Items,
                (outputs, sources) => {
                var sourcesMap = sources.ToLookup(s => s);
                return(ImmutableArray.CreateRange(outputs.Where(output => sourcesMap.Contains(output.LogSource))));
            }
                );

            Refresh();
        }
Ejemplo n.º 13
0
 public UpdateCacheCommandHandler(
     IAsyncLogProvider owner,
     LJTraceSource tracer,
     MessagesContainers.RangesManagingCollection buffer,
     Settings.IGlobalSettingsAccessor settingsAccessor
     )
 {
     this.owner            = owner;
     this.buffer           = buffer;
     this.tracer           = tracer;
     this.settingsAccessor = settingsAccessor;
 }
Ejemplo n.º 14
0
 public LogSourcesManager(
     IHeartBeatTimer heartbeat,
     IInvokeSynchronization invoker,
     IModelThreads threads,
     ITempFilesManager tempFilesManager,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor globalSettingsAccess
     ) : this(heartbeat,
              new LogSourceFactory(threads, bookmarks, invoker, storageManager, tempFilesManager, globalSettingsAccess))
 {
 }
Ejemplo n.º 15
0
 public SearchObjectsFactory(
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     IInvokeSynchronization modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector
     )
 {
     this.progressAggregatorFactory = progressAggregatorFactory;
     this.modelSynchronization      = modelSynchronization;
     this.settings           = settings;
     this.telemetryCollector = telemetryCollector;
 }
Ejemplo n.º 16
0
 public SearchObjectsFactory(
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     ISynchronizationContext modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.progressAggregatorFactory = progressAggregatorFactory;
     this.modelSynchronization      = modelSynchronization;
     this.settings           = settings;
     this.telemetryCollector = telemetryCollector;
     this.traceSourceFactory = traceSourceFactory;
 }
Ejemplo n.º 17
0
 public SearchManager(
     ILogSourcesManager sources,
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     IInvokeSynchronization modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector,
     IHeartBeatTimer heartBeat
     ) : this(
         sources,
         modelSynchronization,
         heartBeat,
         new SearchObjectsFactory(progressAggregatorFactory, modelSynchronization, settings, telemetryCollector)
         )
 {
 }
Ejemplo n.º 18
0
 public SearchManager(
     ILogSourcesManager sources,
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     ISynchronizationContext modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector,
     IChangeNotification changeNotification,
     ITraceSourceFactory traceSourceFactory
     ) : this(
         sources,
         modelSynchronization,
         new SearchObjectsFactory(progressAggregatorFactory, modelSynchronization, settings, telemetryCollector, traceSourceFactory),
         changeNotification
         )
 {
 }
Ejemplo n.º 19
0
 public LogSourcesManager(
     IHeartBeatTimer heartbeat,
     ISynchronizationContext invoker,
     IModelThreadsInternal threads,
     ITempFilesManager tempFilesManager,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     MRU.IRecentlyUsedEntities recentlyUsedEntities,
     IShutdown shutdown,
     ITraceSourceFactory traceSourceFactory,
     IChangeNotification changeNotification
     ) : this(heartbeat, recentlyUsedEntities, shutdown, traceSourceFactory, changeNotification,
              new LogSourceFactory(threads, bookmarks, invoker, storageManager, tempFilesManager, globalSettingsAccess, traceSourceFactory))
 {
 }
Ejemplo n.º 20
0
 public LogSourceFactory(
     IModelThreads threads,
     IBookmarks bookmarks,
     IInvokeSynchronization invoker,
     Persistence.IStorageManager storageManager,
     ITempFilesManager tempFilesManager,
     Settings.IGlobalSettingsAccessor globalSettingsAccess
     )
 {
     this.threads              = threads;
     this.bookmarks            = bookmarks;
     this.invoker              = invoker;
     this.storageManager       = storageManager;
     this.tempFilesManager     = tempFilesManager;
     this.globalSettingsAccess = globalSettingsAccess;
 }
Ejemplo n.º 21
0
        public PresentationModel(
            ILogSourcesManager logSources,
            IInvokeSynchronization modelInvoke,
            IModelThreads modelThreads,
            IFiltersList hlFilters,
            IBookmarks bookmarks,
            Settings.IGlobalSettingsAccessor settings
            )
        {
            this.logSources   = logSources;
            this.modelThreads = modelThreads;
            this.hlFilters    = hlFilters;
            this.bookmarks    = bookmarks;
            this.settings     = settings;

            updateSourcesInvoker = new AsyncInvokeHelper(modelInvoke, UpdateSources);

            logSources.OnLogSourceColorChanged += (s, e) =>
            {
                if (OnLogSourceColorChanged != null)
                {
                    OnLogSourceColorChanged(s, e);
                }
            };
            logSources.OnLogSourceAdded += (s, e) =>
            {
                updateSourcesInvoker.Invoke();
            };
            logSources.OnLogSourceRemoved += (s, e) =>
            {
                updateSourcesInvoker.Invoke();
            };
            logSources.OnLogSourceStatsChanged += (s, e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.PositionsRange) != 0)
                {
                    if ((e.Flags & LogProviderStatsFlag.AvailableTimeUpdatedIncrementallyFlag) == 0)
                    {
                        updateSourcesInvoker.Invoke();
                    }
                    else if (OnSourceMessagesChanged != null)
                    {
                        OnSourceMessagesChanged(this, EventArgs.Empty);
                    }
                }
            };
        }
Ejemplo n.º 22
0
        static long CalcMaxActiveRangeSize(Settings.IGlobalSettingsAccessor settings, FileRange.Range availableRange)
        {
            long MB                 = 1024 * 1024;
            long sizeThreshold      = settings.FileSizes.Threshold * MB;
            long partialLoadingSize = settings.FileSizes.WindowSize * MB;

            long currentSize = availableRange.End - availableRange.Begin;

            if (currentSize < sizeThreshold)
            {
                return(currentSize);
            }
            else
            {
                return(partialLoadingSize);
            }
        }
Ejemplo n.º 23
0
 public LogSourceFactory(
     IModelThreadsInternal threads,
     IBookmarks bookmarks,
     ISynchronizationContext invoker,
     Persistence.IStorageManager storageManager,
     ITempFilesManager tempFilesManager,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.threads              = threads;
     this.bookmarks            = bookmarks;
     this.invoker              = invoker;
     this.storageManager       = storageManager;
     this.tempFilesManager     = tempFilesManager;
     this.globalSettingsAccess = globalSettingsAccess;
     this.traceSourceFactory   = traceSourceFactory;
 }
Ejemplo n.º 24
0
        public SearchResult(
            ISearchManagerInternal owner,
            SearchAllOptions options,
            IFilter optionsFilter,
            IList <ILogSourceSearchWorkerInternal> workers,
            Progress.IProgressAggregatorFactory progressAggregatorFactory,
            ISynchronizationContext modelSynchronization,
            Settings.IGlobalSettingsAccessor settings,
            int id,
            ISearchObjectsFactory factory,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.owner                = owner;
            this.options              = options;
            this.optionsFilter        = optionsFilter;
            this.factory              = factory;
            this.modelSynchronization = modelSynchronization;
            this.id                     = id;
            this.cancellation           = new CancellationTokenSource();
            this.results                = new List <ISourceSearchResultInternal>();
            this.progressAggregator     = progressAggregatorFactory.CreateProgressAggregator();
            this.updateInvokationHelper = new AsyncInvokeHelper(modelSynchronization, UpdateStatus);
            this.hitsLimit              = settings.MaxNumberOfHitsInSearchResultsView;
            this.visible                = true;
            this.trace                  = traceSourceFactory.CreateTraceSource("SearchManager", "sr." + id.ToString());
            this.timeGapsDetector       = new TimeGapsDetector(trace, modelSynchronization, this, traceSourceFactory);

            this.timeGapsDetector.OnTimeGapsChanged += (s, e) =>
            {
                owner.OnResultChanged(this, SearchResultChangeFlag.TimeGapsChanged);
            };

            this.progressAggregator.ProgressChanged += HandleProgressChanged;

            this.searchTime = Stopwatch.StartNew();
            this.results.AddRange(workers.Select(w => factory.CreateSourceSearchResults(w, this, cancellation.Token, progressAggregator)));
            if (results.Count == 0)
            {
                status = SearchResultStatus.Finished;
                HandleFinalStateTransition();
            }
        }
Ejemplo n.º 25
0
 public SearchResultMessagesModel(
     ILogSourcesManager logSources,
     ISearchManager searchManager,
     IFiltersFactory filtersFactory,
     IModelThreads threads,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor settings
     )
 {
     this.logSources     = logSources;
     this.searchManager  = searchManager;
     this.threads        = threads;
     this.bookmarks      = bookmarks;
     this.settings       = settings;
     this.filtersFactory = filtersFactory;
     logSources.OnLogSourceColorChanged += (s, e) =>
     {
         OnLogSourceColorChanged?.Invoke(s, e);
     };
 }
Ejemplo n.º 26
0
 internal MediaBasedPositionedMessagesReader(
     ILogMedia media,
     BoundFinder beginFinder,
     BoundFinder endFinder,
     MessagesReaderExtensions.XmlInitializationParams extensionsInitData,
     TextStreamPositioningParams textStreamPositioningParams,
     MessagesReaderFlags flags,
     Settings.IGlobalSettingsAccessor settingsAccessor
     )
 {
     this.beginFinder = beginFinder;
     this.endFinder   = endFinder;
     this.media       = media;
     this.textStreamPositioningParams = textStreamPositioningParams;
     this.singleThreadedStrategy      = new Lazy <BaseStrategy>(CreateSingleThreadedStrategy);
     this.multiThreadedStrategy       = new Lazy <BaseStrategy>(CreateMultiThreadedStrategy);
     this.extensions       = new MessagesReaderExtensions(this, extensionsInitData);
     this.flags            = flags;
     this.settingsAccessor = settingsAccessor;
 }
Ejemplo n.º 27
0
        public LogSource(ILogSourcesManagerInternal owner, int id,
                         ILogProviderFactory providerFactory, IConnectionParams connectionParams,
                         IModelThreadsInternal threads, ITempFilesManager tempFilesManager, Persistence.IStorageManager storageManager,
                         ISynchronizationContext modelSyncContext, Settings.IGlobalSettingsAccessor globalSettingsAccess, IBookmarks bookmarks,
                         ITraceSourceFactory traceSourceFactory, RegularExpressions.IRegexFactory regexFactory, LogMedia.IFileSystem fileSystem)
        {
            this.owner                = owner;
            this.tracer               = traceSourceFactory.CreateTraceSource("LogSource", string.Format("ls{0:D2}", id));
            this.tempFilesManager     = tempFilesManager;
            this.modelSyncContext     = modelSyncContext;
            this.globalSettingsAccess = globalSettingsAccess;
            this.bookmarks            = bookmarks;
            this.traceSourceFactory   = traceSourceFactory;
            this.regexFactory         = regexFactory;
            this.fileSystem           = fileSystem;

            try
            {
                this.logSourceThreads              = new LogSourceThreads(this.tracer, threads, this);
                this.timeGaps                      = new TimeGapsDetector(tracer, modelSyncContext, new LogSourceGapsSource(this), traceSourceFactory);
                this.timeGaps.OnTimeGapsChanged   += timeGaps_OnTimeGapsChanged;
                this.logSourceSpecificStorageEntry = CreateLogSourceSpecificStorageEntry(providerFactory, connectionParams, storageManager);

                var extendedConnectionParams = connectionParams.Clone(true);
                this.LoadPersistedSettings(extendedConnectionParams);
                this.provider = providerFactory.CreateFromConnectionParams(this, extendedConnectionParams);
            }
            catch (Exception e)
            {
                tracer.Error(e, "Failed to initialize log source");
                ((ILogSource)this).Dispose();
                throw;
            }

            this.owner.Add(this);
            this.owner.FireOnLogSourceAdded(this);

            this.LoadBookmarks();
        }
Ejemplo n.º 28
0
 public LogSourceFactory(
     IModelThreadsInternal threads,
     IBookmarks bookmarks,
     ISynchronizationContext invoker,
     Persistence.IStorageManager storageManager,
     ITempFilesManager tempFilesManager,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory,
     LogMedia.IFileSystem fileSystem
     )
 {
     this.threads              = threads;
     this.bookmarks            = bookmarks;
     this.invoker              = invoker;
     this.storageManager       = storageManager;
     this.tempFilesManager     = tempFilesManager;
     this.globalSettingsAccess = globalSettingsAccess;
     this.traceSourceFactory   = traceSourceFactory;
     this.regexFactory         = regexFactory;
     this.fileSystem           = fileSystem;
 }
Ejemplo n.º 29
0
        public FiltersManager(
            IFiltersFactory filtersFactory,
            Settings.IGlobalSettingsAccessor globalSettingsAccessor,
            ILogSourcesManager logSourcesManager,
            IShutdown shutdown
            )
        {
            this.globalSettings = globalSettingsAccessor;
            this.logSources     = logSourcesManager;

            this.highlightFilters = filtersFactory.CreateFiltersList(FilterAction.Exclude, FiltersListPurpose.Highlighting);

            this.logSources.OnLogSourceRemoved += (s, e) =>
            {
                highlightFilters.PurgeDisposedFiltersAndFiltersHavingDisposedThreads();
            };

            shutdown.Cleanup += (sender, args) =>
            {
                highlightFilters.Dispose();
            };
        }
Ejemplo n.º 30
0
 public PresenterFactory(
     IChangeNotification changeNotification,
     IHeartBeatTimer heartbeat,
     IPresentersFacade presentationFacade,
     IClipboardAccess clipboard,
     IBookmarksFactory bookmarksFactory,
     Telemetry.ITelemetryCollector telemetry,
     ILogSourcesManager logSources,
     ISynchronizationContext modelInvoke,
     IModelThreads modelThreads,
     IFiltersList hlFilters,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor settings,
     ISearchManager searchManager,
     IFiltersFactory filtersFactory,
     IColorTheme theme,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory
     )
 {
     this.changeNotification = changeNotification;
     this.heartbeat          = heartbeat;
     this.presentationFacade = presentationFacade;
     this.clipboard          = clipboard;
     this.bookmarksFactory   = bookmarksFactory;
     this.telemetry          = telemetry;
     this.logSources         = logSources;
     this.modelInvoke        = modelInvoke;
     this.modelThreads       = modelThreads;
     this.hlFilters          = hlFilters;
     this.bookmarks          = bookmarks;
     this.settings           = settings;
     this.searchManager      = searchManager;
     this.filtersFactory     = filtersFactory;
     this.theme = theme;
     this.traceSourceFactory = traceSourceFactory;
     this.regexFactory       = regexFactory;
 }