public static void LogProcessActiveFileDocument(CountLogAggregator <object> logAggregator, Guid _, bool processed) { if (processed) { logAggregator.IncreaseCount(ActiveFileProcessDocument); } else { logAggregator.IncreaseCount(ActiveFileProcessDocumentCancellation); } }
public static void LogProcessProject(CountLogAggregator <object> logAggregator, Guid projectId, bool processed) { if (processed) { logAggregator.IncreaseCount(ProcessProject); } else { logAggregator.IncreaseCount(ProcessProjectCancellation); } logAggregator.IncreaseCount(ValueTuple.Create(ProcessProject, projectId)); }
public static void LogWorkCoordinatorShutdown(int correlationId, CountLogAggregator <WorkspaceChangeKind> logAggregator) { Logger.Log(FunctionId.WorkCoordinator_Shutdown, KeyValueLogMessage.Create(m => { m[Id] = correlationId; foreach (var kv in logAggregator) { var change = kv.Key.ToString(); m[change] = kv.Value.GetCount(); } })); }
public RequestTelemetryLogger(string serverTypeName) { _serverTypeName = serverTypeName; _requestCounters = new(); _findDocumentResults = new(); _usedForkedSolutionCounter = new(); // Buckets queued duration into 10ms buckets with the last bucket starting at 1000ms. // Queue times are relatively short and fall under 50ms, so tracking past 1000ms is not useful. _queuedDurationLogAggregator = new HistogramLogAggregator <string>(bucketSize: 10, maxBucketValue: 1000); // Since this is a log based histogram, these are appropriate bucket sizes for the log data. // A bucket at 1 corresponds to ~26ms, while the max bucket value corresponds to ~17minutes _requestDurationLogAggregator = new HistogramLogAggregator <string>(bucketSize: 1, maxBucketValue: 40); }
public static void LogWorkItemEnqueue( CountLogAggregator <object> logAggregator, string language, DocumentId?documentId, InvocationReasons reasons, bool lowPriority, SyntaxPath?activeMember, bool added) { logAggregator.IncreaseCount(language); logAggregator.IncreaseCount(added ? NewWorkItem : UpdateWorkItem); if (documentId != null) { logAggregator.IncreaseCount(activeMember == null ? TopLevel : MemberLevel); if (lowPriority) { logAggregator.IncreaseCount(LowerPriority); logAggregator.IncreaseCount(ValueTuple.Create(LowerPriority, documentId.Id)); } } foreach (var reason in reasons) { logAggregator.IncreaseCount(reason); } }
public static void LogProcessProjectNotExist(CountLogAggregator <object> logAggregator) => logAggregator.IncreaseCount(ProjectNotExist);
public static void LogProcessOpenDocument(CountLogAggregator <object> logAggregator, Guid documentId) { logAggregator.IncreaseCount(OpenDocument); logAggregator.IncreaseCount(ValueTuple.Create(OpenDocument, documentId)); }
public static void LogIncrementalAnalyzerProcessorStatistics(int correlationId, Solution solution, CountLogAggregator <object> logAggregator, ImmutableArray <IIncrementalAnalyzer> analyzers) { Logger.Log(FunctionId.IncrementalAnalyzerProcessor_Shutdown, KeyValueLogMessage.Create(m => { var solutionHash = GetSolutionHash(solution); m[Id] = correlationId; m[SolutionHash] = solutionHash.ToString(); var statMap = new Dictionary <string, List <int> >(); foreach (var(key, counter) in logAggregator) { if (key is string stringKey) { m[stringKey] = counter.GetCount(); } else if (key is ValueTuple <string, Guid> propertyNameAndId) { var list = statMap.GetOrAdd(propertyNameAndId.Item1, _ => new List <int>()); list.Add(counter.GetCount()); } else { throw ExceptionUtilities.Unreachable; } } foreach (var(propertyName, propertyValues) in statMap) { var result = StatisticResult.FromList(propertyValues); m[CreateProperty(propertyName, Max)] = result.Maximum; m[CreateProperty(propertyName, Min)] = result.Minimum; m[CreateProperty(propertyName, Median)] = result.Median !.Value; m[CreateProperty(propertyName, Mean)] = result.Mean; m[CreateProperty(propertyName, Mode)] = result.Mode !.Value; m[CreateProperty(propertyName, Range)] = result.Range; m[CreateProperty(propertyName, Count)] = result.Count; } })); foreach (var analyzer in analyzers) { analyzer.LogAnalyzerCountSummary(); } }
public static void LogResetStates(CountLogAggregator <object> logAggregator) => logAggregator.IncreaseCount(ResetStates);
public static void LogHigherPriority(CountLogAggregator <object> logAggregator, Guid documentId) { logAggregator.IncreaseCount(HigherPriority); logAggregator.IncreaseCount(ValueTuple.Create(HigherPriority, documentId)); }
public static void LogWorkItemEnqueue(CountLogAggregator <object> logAggregator, ProjectId _) => logAggregator.IncreaseCount(ProjectEnqueue);
public static void LogActiveFileEnqueue(CountLogAggregator <object> logAggregator) => logAggregator.IncreaseCount(ActiveFileEnqueue);
public static void LogGlobalOperation(CountLogAggregator <object> logAggregator) => logAggregator.IncreaseCount(GlobalOperation);
public static void LogWorkspaceEvent(CountLogAggregator <WorkspaceChangeKind> logAggregator, WorkspaceChangeKind kind) => logAggregator.IncreaseCount(kind);
private void ResetLogAggregator() => _logAggregator = new CountLogAggregator <object>();