Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire telemetry when REPLs are launched via shift+enter #23944

Merged
merged 1 commit into from
Aug 13, 2024
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
3 changes: 3 additions & 0 deletions src/client/repl/nativeRepl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { PythonEnvironment } from '../pythonEnvironments/info';
import { createPythonServer, PythonServer } from './pythonServer';
import { executeNotebookCell, openInteractiveREPL, selectNotebookKernel } from './replCommandHandler';
import { createReplController } from './replController';
import { EventName } from '../telemetry/constants';
import { sendTelemetryEvent } from '../telemetry';

export class NativeRepl implements Disposable {
// Adding ! since it will get initialized in create method, not the constructor.
Expand Down Expand Up @@ -159,6 +161,7 @@ let nativeRepl: NativeRepl | undefined; // In multi REPL scenario, hashmap of UR
*/
export async function getNativeRepl(interpreter: PythonEnvironment, disposables: Disposable[]): Promise<NativeRepl> {
if (!nativeRepl) {
sendTelemetryEvent(EventName.REPL, undefined, { replType: 'Native' });
nativeRepl = await NativeRepl.create(interpreter);
disposables.push(nativeRepl);
}
Expand Down
4 changes: 3 additions & 1 deletion src/client/terminals/codeExecution/terminalCodeExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { IInterpreterService } from '../../interpreter/contracts';
import { traceInfo } from '../../logging';
import { buildPythonExecInfo, PythonExecInfo } from '../../pythonEnvironments/exec';
import { ICodeExecutionService } from '../../terminals/types';
import { EventName } from '../../telemetry/constants';
import { sendTelemetryEvent } from '../../telemetry';

@injectable()
export class TerminalCodeExecutionProvider implements ICodeExecutionService {
Expand Down Expand Up @@ -67,7 +69,7 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService {
await terminalService.show();
return;
}

sendTelemetryEvent(EventName.REPL, undefined, { replType: 'Terminal' });
this.replActive = new Promise<boolean>(async (resolve) => {
const replCommandArgs = await this.getExecutableInfo(resource);
let listener: IDisposable;
Expand Down
Loading