Skip to content

Commit e520991

Browse files
committed
measure delays in completions
1 parent 3faf796 commit e520991

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

src/client/common/telemetry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export class Delays {
4444
shortDelays: this.shortDelays,
4545
mediumDelays: this.mediumDelays,
4646
idleDelays: this.idleDelays,
47-
nonFocusDelays: this.nonFocusDelays
47+
nonFocusDelays: this.nonFocusDelays,
48+
bigDelays: this.bigDelays
4849
};
4950
}
5051
}

src/client/debugger/Main.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ export class PythonDebugger extends DebugSession {
232232
this.sendEvent(new OutputEvent(`Warning 'pyenv.cfg' can interfere with the debugger. Please rename or delete this file (temporary solution)`));
233233
}
234234

235-
this.sendEvent(new TelemetryEvent(telemetryContracts.Debugger.Load, {
236-
Debug_Console: args.console,
237-
Debug_DebugOptions: args.debugOptions.join(","),
238-
Debug_DJango: args.debugOptions.indexOf("DjangoDebugging") >= 0 ? "true" : "false",
239-
Debug_PySpark: typeof args.pythonPath === 'string' && args.pythonPath.indexOf('spark-submit') > 0 ? 'true' : 'false',
240-
Debug_HasEnvVaraibles: args.env && typeof args.env === "object" && Object.keys(args.env).length > 0 ? "true" : "false"
241-
}));
235+
// this.sendEvent(new TelemetryEvent(telemetryContracts.Debugger.Load, {
236+
// Debug_Console: args.console,
237+
// Debug_DebugOptions: args.debugOptions.join(","),
238+
// Debug_DJango: args.debugOptions.indexOf("DjangoDebugging") >= 0 ? "true" : "false",
239+
// Debug_PySpark: typeof args.pythonPath === 'string' && args.pythonPath.indexOf('spark-submit') > 0 ? 'true' : 'false',
240+
// Debug_HasEnvVaraibles: args.env && typeof args.env === "object" && Object.keys(args.env).length > 0 ? "true" : "false"
241+
// }));
242242

243243
this.launchArgs = args;
244244
this.debugClient = CreateLaunchDebugClient(args, this);

src/client/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export function activate(context: vscode.ExtensionContext) {
4242
let pythonSettings = settings.PythonSettings.getInstance();
4343
let pythonExt = new PythonExt();
4444
const hasPySparkInCompletionPath = pythonSettings.autoComplete.extraPaths.some(p => p.toLowerCase().indexOf('spark') >= 0);
45-
telemetryHelper.sendTelemetryEvent(telemetryContracts.EVENT_LOAD, {
46-
CodeComplete_Has_ExtraPaths: pythonSettings.autoComplete.extraPaths.length > 0 ? 'true' : 'false',
47-
Format_Has_Custom_Python_Path: pythonSettings.pythonPath.length !== 'python'.length ? 'true' : 'false',
48-
Has_PySpark_Path: hasPySparkInCompletionPath ? 'true' : 'false'
49-
});
45+
// telemetryHelper.sendTelemetryEvent(telemetryContracts.EVENT_LOAD, {
46+
// CodeComplete_Has_ExtraPaths: pythonSettings.autoComplete.extraPaths.length > 0 ? 'true' : 'false',
47+
// Format_Has_Custom_Python_Path: pythonSettings.pythonPath.length !== 'python'.length ? 'true' : 'false',
48+
// Has_PySpark_Path: hasPySparkInCompletionPath ? 'true' : 'false'
49+
// });
5050
lintingOutChannel = vscode.window.createOutputChannel(pythonSettings.linting.outputWindow);
5151
formatOutChannel = lintingOutChannel;
5252
if (pythonSettings.linting.outputWindow !== pythonSettings.formatting.outputWindow) {

src/client/providers/completionProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as vscode from 'vscode';
44
import * as proxy from './jediProxy';
5+
import * as telemetryHelper from '../common/telemetry';
56
import * as telemetryContracts from '../common/telemetryContracts';
67
import { extractSignatureAndDocumentation } from './jediHelpers';
78
import { EOL } from 'os';
@@ -65,8 +66,12 @@ export class PythonCompletionItemProvider implements vscode.CompletionItemProvid
6566
source: source
6667
};
6768

69+
const timer = new telemetryHelper.Delays();
6870
return this.jediProxyHandler.sendCommand(cmd, token).then(data => {
69-
return PythonCompletionItemProvider.parseData(data);
71+
timer.stop();
72+
telemetryHelper.sendTelemetryEvent(telemetryContracts.IDE.Completion, {}, timer.toMeasures());
73+
const completions = PythonCompletionItemProvider.parseData(data);
74+
return completions;
7075
});
7176
}
7277
}

0 commit comments

Comments
 (0)