Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6a9c22
Remove stale reference
Sep 30, 2019
1360827
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 1, 2019
ccaaa02
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 4, 2019
da40dcc
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 4, 2019
c348ac3
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 5, 2019
53bc044
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 7, 2019
484a92a
Merge branch 'master' of https://github.com/MikhailArkhipov/python-la…
Oct 7, 2019
e6df3aa
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 8, 2019
1d289d8
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 8, 2019
126f355
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 12, 2019
7e715f3
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 25, 2019
32923a5
Merge branch 'master' of https://github.com/microsoft/python-language…
Oct 31, 2019
1b72f4b
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 2, 2019
f74d5b6
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 7, 2019
0b28fa4
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 12, 2019
6109ac7
Don't suppress LHS diagnostics on augmented assign
Nov 12, 2019
bcfc3b7
Revert "Don't suppress LHS diagnostics on augmented assign"
Nov 12, 2019
dc286b8
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 13, 2019
0aab4f5
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 16, 2019
b953ce7
Merge branch 'master' of https://github.com/microsoft/python-language…
Nov 18, 2019
aef887d
Merge branch 'master' of https://github.com/microsoft/python-language…
Dec 10, 2019
b97b641
Merge branch 'master' of https://github.com/microsoft/python-language…
Dec 11, 2019
c16646d
Escape [ and ]
Dec 13, 2019
f3e08d5
Merge branch 'master' of https://github.com/MikhailArkhipov/python-la…
Dec 13, 2019
5700642
PR feedback
Dec 13, 2019
b816c8c
Handle non-critical issues in telemetry
Dec 13, 2019
643963f
Merge branch 'master' of https://github.com/microsoft/python-language…
Dec 13, 2019
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
43 changes: 25 additions & 18 deletions src/LanguageServer/Impl/Implementation/Server.Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

using System;
using System.Diagnostics;
using Microsoft.Python.Analysis.Analyzer;
using Microsoft.Python.Core;
Expand All @@ -29,28 +30,34 @@ private void OnAnalysisComplete(object sender, AnalysisCompleteEventArgs e) {
return;
}

double privateMB;
double peakPagedMB;
double workingMB;
try {
double privateMB;
double peakPagedMB;
double workingMB;

using (var proc = Process.GetCurrentProcess()) {
privateMB = proc.PrivateMemorySize64 / 1e+6;
peakPagedMB = proc.PeakPagedMemorySize64 / 1e+6;
workingMB = proc.WorkingSet64 / 1e+6;
}
using (var proc = Process.GetCurrentProcess()) {
privateMB = proc.PrivateMemorySize64 / 1e+6;
peakPagedMB = proc.PeakPagedMemorySize64 / 1e+6;
workingMB = proc.WorkingSet64 / 1e+6;
}

var te = new TelemetryEvent {
EventName = "python_language_server/analysis_complete", // TODO: Move this common prefix into Core.
};
var te = new TelemetryEvent {
EventName = "python_language_server/analysis_complete", // TODO: Move this common prefix into Core.
};

te.Measurements["privateMB"] = privateMB;
te.Measurements["peakPagedMB"] = peakPagedMB;
te.Measurements["workingMB"] = workingMB;
te.Measurements["elapsedMs"] = e.MillisecondsElapsed;
te.Measurements["moduleCount"] = e.ModuleCount;
te.Measurements["rdtCount"] = _rdt.DocumentCount;
te.Measurements["privateMB"] = privateMB;
te.Measurements["peakPagedMB"] = peakPagedMB;
te.Measurements["workingMB"] = workingMB;
te.Measurements["elapsedMs"] = e.MillisecondsElapsed;
te.Measurements["moduleCount"] = e.ModuleCount;
te.Measurements["rdtCount"] = _rdt.DocumentCount;

telemetry.SendTelemetryAsync(te).DoNotWait();
telemetry.SendTelemetryAsync(te).DoNotWait();
} catch(Exception ex) when (!ex.IsCriticalException()) {
// Workaround for https://github.com/microsoft/python-language-server/issues/1820
// On some systems random DLL may get missing or otherwise not installed
// and we don't want to crash b/c of telemetry.
}
}
}
}