Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Add RDT count to the analysis_complete event #1396

Merged
merged 2 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,10 @@ public interface IRunningDocumentTable {
/// Fires when document is removed.
/// </summary>
event EventHandler<DocumentEventArgs> Removed;

/// <summary>
/// Gets the number of documents in the table.
/// </summary>
int DocumentCount { get; }
}
}
8 changes: 8 additions & 0 deletions src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public IEnumerable<IDocument> GetDocuments() {
}
}

public int DocumentCount {
get {
lock (_lock) {
return _documentsByUri.Count;
}
}
}

/// <summary>
/// Adds file to the list of available documents.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/LanguageServer/Impl/Implementation/Server.Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private void OnAnalysisComplete(object sender, AnalysisCompleteEventArgs e) {
te.Measurements["workingMB"] = workingMB;
te.Measurements["elapsedMs"] = e.MillisecondsElapsed;
te.Measurements["moduleCount"] = e.ModuleCount;
te.Measurements["rdtCount"] = _rdt.DocumentCount;

telemetry.SendTelemetryAsync(te).DoNotWait();
}
Expand Down