protected override async Task ExecuteAsync() { // wait for global operation to finish await GlobalOperationTask.ConfigureAwait(false); // cancel updating solution checksum if a global operation (such as loading solution, building solution and etc) has started await UpdateSolutionChecksumAsync(_globalOperationCancellationSource.Token).ConfigureAwait(false); }
protected override async Task ExecuteAsync() { lock (_gate) { _lastToken?.Dispose(); _lastToken = null; } // wait for global operation to finish await GlobalOperationTask.ConfigureAwait(false); // update primary solution in remote host await SynchronizePrimaryWorkspaceAsync(_globalOperationCancellationSource.Token).ConfigureAwait(false); }
protected override async Task ExecuteAsync() { // wait for global operation to finish await GlobalOperationTask.ConfigureAwait(false); // cancel updating solution checksum if a global operation (such as loading solution, building solution and etc) has started await UpdateSolutionChecksumAsync(_globalOperationCancellationSource.Token).ConfigureAwait(false); // check whether we had bulk change that require asset synchronization if (_synchronize) { await SynchronizeAssets().ConfigureAwait(false); } }
protected override async Task ExecuteAsync() { // wait for global operation such as build await GlobalOperationTask.ConfigureAwait(false); using (var pooledObject = SharedPools.Default <List <ExpensiveAnalyzerInfo> >().GetPooledObject()) using (RoslynLogger.LogBlock(FunctionId.Diagnostics_GeneratePerformaceReport, CancellationToken)) { _diagnosticAnalyzerPerformanceTracker.GenerateReport(pooledObject.Object); foreach (var analyzerInfo in pooledObject.Object) { var newAnalyzer = _reported.Add(analyzerInfo.AnalyzerId); var isInternalUser = _telemetrySession.IsUserMicrosoftInternal; // we only report same analyzer once unless it is internal user if (isInternalUser || newAnalyzer) { // this will report telemetry under VS. this will let us see how accurate our performance tracking is RoslynLogger.Log(FunctionId.Diagnostics_BadAnalyzer, KeyValueLogMessage.Create(m => { // since it is telemetry, we hash analyzer name if it is not builtin analyzer m[nameof(analyzerInfo.AnalyzerId)] = isInternalUser ? analyzerInfo.AnalyzerId : analyzerInfo.PIISafeAnalyzerId; m[nameof(analyzerInfo.LocalOutlierFactor)] = analyzerInfo.LocalOutlierFactor; m[nameof(analyzerInfo.Average)] = analyzerInfo.Average; m[nameof(analyzerInfo.AdjustedStandardDeviation)] = analyzerInfo.AdjustedStandardDeviation; })); } // for logging, we only log once. we log here so that we can ask users to provide this log to us // when we want to find out VS performance issue that could be caused by analyzer if (newAnalyzer) { _logger.TraceEvent(TraceEventType.Warning, 0, $"Analyzer perf indicators exceeded threshold for '{analyzerInfo.AnalyzerId}' ({analyzerInfo.AnalyzerIdHash}): " + $"LOF: {analyzerInfo.LocalOutlierFactor}, Avg: {analyzerInfo.Average}, Stddev: {analyzerInfo.AdjustedStandardDeviation}"); } } } }