public DiagnosticComputer(Project project) { _project = project; _exceptions = new Dictionary <DiagnosticAnalyzer, HashSet <DiagnosticData> >(); // we only track performance from primary branch. all forked branch we don't care such as preview. _performanceTracker = project.IsFromPrimaryBranch() ? project.Solution.Workspace.Services.GetService <IPerformanceTrackerService>() : null; }
public PerformanceReporter(TraceSource logger, IPerformanceTrackerService diagnosticAnalyzerPerformanceTracker, TimeSpan reportingInterval, CancellationToken shutdownToken) : base( AsynchronousOperationListenerProvider.NullListener, SolutionService.PrimaryWorkspace.Services.GetService <IGlobalOperationNotificationService>(), (int)reportingInterval.TotalMilliseconds, shutdownToken) { _event = new SemaphoreSlim(initialCount: 0); _reported = new HashSet <string>(); _logger = logger; _diagnosticAnalyzerPerformanceTracker = diagnosticAnalyzerPerformanceTracker; _diagnosticAnalyzerPerformanceTracker.SnapshotAdded += OnSnapshotAdded; Start(); }
public PerformanceReporter( TraceSource logger, TelemetrySession telemetrySession, IPerformanceTrackerService diagnosticAnalyzerPerformanceTracker, IGlobalOperationNotificationService globalOperationNotificationService, CancellationToken shutdownToken) : base( AsynchronousOperationListenerProvider.NullListener, globalOperationNotificationService, backOffTimeSpan: TimeSpan.FromMinutes(2), shutdownToken) { _event = new SemaphoreSlim(initialCount: 0); _reported = new HashSet <string>(); _logger = logger; _telemetrySession = telemetrySession; _diagnosticAnalyzerPerformanceTracker = diagnosticAnalyzerPerformanceTracker; _diagnosticAnalyzerPerformanceTracker.SnapshotAdded += OnSnapshotAdded; Start(); }