Skip to content
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
2 changes: 2 additions & 0 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export enum EventName {
TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL = 'TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL',
TENSORBOARD_PACKAGE_INSTALL_RESULT = 'TENSORBOARD.PACKAGE_INSTALL_RESULT',
TENSORBOARD_TORCH_PROFILER_IMPORT = 'TENSORBOARD.TORCH_PROFILER_IMPORT',
TENSORBOARD_JUMP_TO_SOURCE_REQUEST = 'TENSORBOARD_JUMP_TO_SOURCE_REQUEST',
TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND = 'TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND',
}

export enum PlatformErrors {
Expand Down
13 changes: 13 additions & 0 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1832,4 +1832,17 @@ export interface IEventNamePropertyMapping {
* `from torch import profiler`.
*/
[EventName.TENSORBOARD_TORCH_PROFILER_IMPORT]: never | undefined;
/**
* Telemetry event sent when the extension host receives a message from the
* TensorBoard webview containing a valid jump to source payload from the
* PyTorch profiler TensorBoard plugin.
*/
[EventName.TENSORBOARD_JUMP_TO_SOURCE_REQUEST]: never | undefined;
/**
* Telemetry event sent when the extension host receives a message from the
* TensorBoard webview containing a valid jump to source payload from the
* PyTorch profiler TensorBoard plugin, but the source file does not exist
* on the machine currently running TensorBoard.
*/
[EventName.TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND]: never | undefined;
}
2 changes: 2 additions & 0 deletions src/client/tensorBoard/tensorBoardSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,12 @@ export class TensorBoardSession {
}

private async jumpToSource(fsPath: string, line: number) {
sendTelemetryEvent(EventName.TENSORBOARD_JUMP_TO_SOURCE_REQUEST);
let uri: Uri | undefined;
if (fs.existsSync(fsPath)) {
uri = Uri.file(fsPath);
} else {
sendTelemetryEvent(EventName.TENSORBOARD_JUMP_TO_SOURCE_FILE_NOT_FOUND);
traceError(
`Requested jump to source filepath ${fsPath} does not exist. Prompting user to select source file...`,
);
Expand Down