From 1070fb6ff6bafc16d1e4e0fdd7f76b5b88e6f335 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Tue, 13 Aug 2024 13:47:06 -0700 Subject: [PATCH] fire telemetry when repl launched via shift+enter --- src/client/repl/nativeRepl.ts | 3 +++ src/client/terminals/codeExecution/terminalCodeExecution.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/repl/nativeRepl.ts b/src/client/repl/nativeRepl.ts index e28d21228666..eaa97f9518df 100644 --- a/src/client/repl/nativeRepl.ts +++ b/src/client/repl/nativeRepl.ts @@ -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. @@ -159,6 +161,7 @@ let nativeRepl: NativeRepl | undefined; // In multi REPL scenario, hashmap of UR */ export async function getNativeRepl(interpreter: PythonEnvironment, disposables: Disposable[]): Promise { if (!nativeRepl) { + sendTelemetryEvent(EventName.REPL, undefined, { replType: 'Native' }); nativeRepl = await NativeRepl.create(interpreter); disposables.push(nativeRepl); } diff --git a/src/client/terminals/codeExecution/terminalCodeExecution.ts b/src/client/terminals/codeExecution/terminalCodeExecution.ts index ce317dec20e7..f2750fedaa07 100644 --- a/src/client/terminals/codeExecution/terminalCodeExecution.ts +++ b/src/client/terminals/codeExecution/terminalCodeExecution.ts @@ -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 { @@ -67,7 +69,7 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService { await terminalService.show(); return; } - + sendTelemetryEvent(EventName.REPL, undefined, { replType: 'Terminal' }); this.replActive = new Promise(async (resolve) => { const replCommandArgs = await this.getExecutableInfo(resource); let listener: IDisposable;