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

Commit 754a668

Browse files
authored
Add RDT count to the analysis_complete event (#1396)
* Add RDT count to the analysis_complete event * Use property instead of method
1 parent bede6cc commit 754a668

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/Analysis/Ast/Impl/Documents/Definitions/IRunningDocumentTable.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,10 @@ public interface IRunningDocumentTable {
9090
/// Fires when document is removed.
9191
/// </summary>
9292
event EventHandler<DocumentEventArgs> Removed;
93+
94+
/// <summary>
95+
/// Gets the number of documents in the table.
96+
/// </summary>
97+
int DocumentCount { get; }
9398
}
9499
}

src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ public IEnumerable<IDocument> GetDocuments() {
6969
}
7070
}
7171

72+
public int DocumentCount {
73+
get {
74+
lock (_lock) {
75+
return _documentsByUri.Count;
76+
}
77+
}
78+
}
79+
7280
/// <summary>
7381
/// Adds file to the list of available documents.
7482
/// </summary>

src/LanguageServer/Impl/Implementation/Server.Telemetry.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ private void OnAnalysisComplete(object sender, AnalysisCompleteEventArgs e) {
4848
te.Measurements["workingMB"] = workingMB;
4949
te.Measurements["elapsedMs"] = e.MillisecondsElapsed;
5050
te.Measurements["moduleCount"] = e.ModuleCount;
51+
te.Measurements["rdtCount"] = _rdt.DocumentCount;
5152

5253
telemetry.SendTelemetryAsync(te).DoNotWait();
5354
}

0 commit comments

Comments
 (0)