Skip to content

Commit 344e982

Browse files
authored
Drop A/B test and search 3 directories deep for tfevent files (microsoft#15234)
* Search up to 3 directories down * Drop A/B test * More consistency with tensorboard CLI codepath * Fix test * Dead code * Use new feature gate name
1 parent a5053a6 commit 344e982

14 files changed

Lines changed: 40 additions & 190 deletions

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@
10471047
"jediLSP",
10481048
"debuggerDataViewer",
10491049
"pythonSendEntireLineToREPL",
1050-
"nativeTensorBoard",
1050+
"pythonTensorboardExperiment",
10511051
"pythonDiscoveryModule",
10521052
"All"
10531053
]
@@ -1076,7 +1076,7 @@
10761076
"jediLSP",
10771077
"debuggerDataViewer",
10781078
"pythonSendEntireLineToREPL",
1079-
"nativeTensorBoard",
1079+
"pythonTensorboardExperiment",
10801080
"pythonDiscoveryModule",
10811081
"All"
10821082
]

pythonFiles/tensorboard_launcher.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import os
21
import time
32
import sys
4-
import tensorboard
3+
from tensorboard import default
4+
from tensorboard import program
55

66

77
def main(logdir):
8-
tb = tensorboard.program.TensorBoard()
8+
tb = program.TensorBoard(
9+
default.get_plugins(),
10+
program.get_default_assets_zip_provider(),
11+
)
912
tb.configure(bind_all=False, logdir=logdir)
1013
url = tb.launch()
1114
sys.stdout.write("TensorBoard started at %s\n" % (url))

src/client/common/experiments/groups.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export enum SendSelectionToREPL {
8585

8686
// Feature flag for 'Python: Launch TensorBoard' feature
8787
export enum NativeTensorBoard {
88-
experiment = 'nativeTensorBoard',
88+
experiment = 'pythonTensorboardExperiment',
8989
}
9090

9191
// Experiment to show a prompt asking users to install or select linter
@@ -95,12 +95,6 @@ export enum LinterInstallationPromptVariants {
9595
noPrompt = 'pythonNotDisplayLinterPrompt',
9696
}
9797

98-
// AB test codeactions vs codelenses as an entrypoint for native TensorBoard sessions
99-
export enum NativeTensorBoardEntrypoints {
100-
codeActions = 'pythonTensorBoardCodeActions',
101-
codeLenses = 'pythonTensorBoardCodeLenses',
102-
}
103-
10498
// Experiment to control which environment discovery mechanism can be used
10599
export enum DiscoveryVariants {
106100
discoverWithFileWatching = 'pythonDiscoveryModule',

src/client/telemetry/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ export enum EventName {
129129
TENSORBOARD_ENTRYPOINT_SHOWN = 'TENSORBOARD.ENTRYPOINT_SHOWN',
130130
TENSORBOARD_INSTALL_PROMPT_SHOWN = 'TENSORBOARD.INSTALL_PROMPT_SHOWN',
131131
TENSORBOARD_INSTALL_PROMPT_SELECTION = 'TENSORBOARD.INSTALL_PROMPT_SELECTION',
132-
TENSORBOARD_IMPORT_CODEACTION_CLICKED = 'TENSORBOARD_IMPORT_CODEACTION_SHOWN',
133-
TENSORBOARD_IMPORT_CODELENS_CLICKED = 'TENSORBOARD_IMPORT_CODELENS_SHOWN',
134132
TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL = 'TENSORBOARD_DETECTED_IN_INTEGRATED_TERMINAL',
135133
}
136134

src/client/telemetry/index.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@ export interface IEventNamePropertyMapping {
17361736
/**
17371737
* Telemetry event sent after the python.launchTensorBoard command has been executed.
17381738
* The `entrypoint` property indicates whether the command was executed directly by the
1739-
* user from the command palette or from a codeaction, codelens, or the user clicking 'yes'
1739+
* user from the command palette or from a codelens or the user clicking 'yes'
17401740
* on the launch prompt we display.
17411741
* The `trigger` property indicates whether the entrypoint was triggered by the user
17421742
* importing tensorboard, using tensorboard in a notebook, detected tfevent files in
@@ -1775,10 +1775,10 @@ export interface IEventNamePropertyMapping {
17751775
[EventName.TENSORBOARD_SESSION_DURATION]: never | undefined;
17761776
/**
17771777
* Telemetry event sent when an entrypoint is displayed to the user. This event is sent once
1778-
* per entrypoint per session to minimize redundant events since codeactions and codelenses
1778+
* per entrypoint per session to minimize redundant events since codelenses
17791779
* can be displayed multiple times per file.
17801780
* The `entrypoint` property indicates whether the command was executed directly by the
1781-
* user from the command palette or from a codeaction, codelens, or the user clicking 'yes'
1781+
* user from the command palette or from a codelens or the user clicking 'yes'
17821782
* on the launch prompt we display.
17831783
* The `trigger` property indicates whether the entrypoint was triggered by the user
17841784
* importing tensorboard, using tensorboard in a notebook, detected tfevent files in
@@ -1802,16 +1802,6 @@ export interface IEventNamePropertyMapping {
18021802
selection: TensorBoardPromptSelection;
18031803
operationType: 'install' | 'upgrade';
18041804
};
1805-
/**
1806-
* Telemetry event indicating the codeaction on a tensorboard import was clicked.
1807-
* Used for A/B testing codeaction vs codelens.
1808-
*/
1809-
[EventName.TENSORBOARD_IMPORT_CODEACTION_CLICKED]: never | undefined;
1810-
/**
1811-
* Telemetry event indicating the codelens above a tensorboard import was clicked.
1812-
* Used for A/B testing codeaction vs codelens.
1813-
*/
1814-
[EventName.TENSORBOARD_IMPORT_CODELENS_CLICKED]: never | undefined;
18151805
/**
18161806
* Telemetry event sent when we find an active integrated terminal running tensorboard.
18171807
*/

src/client/tensorBoard/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export enum TensorBoardSessionStartResult {
2020

2121
export enum TensorBoardEntrypoint {
2222
prompt = 'prompt',
23-
codeaction = 'codeaction',
2423
codelens = 'codelens',
2524
palette = 'palette',
2625
}

src/client/tensorBoard/nbextensionCodeLensProvider.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,14 @@ export class TensorBoardNbextensionCodeLensProvider implements IExtensionSingleA
5151
title: TensorBoard.launchNativeTensorBoardSessionCodeLens(),
5252
command: Commands.LaunchTensorBoard,
5353
arguments: [
54-
{ trigger: TensorBoardEntrypointTrigger.fileimport, entrypoint: TensorBoardEntrypoint.codelens },
54+
{ trigger: TensorBoardEntrypointTrigger.nbextension, entrypoint: TensorBoardEntrypoint.codelens },
5555
],
5656
};
5757
const codelenses: CodeLens[] = [];
5858
for (let index = 0; index < document.lineCount; index += 1) {
5959
const line = document.lineAt(index);
6060
if (containsNotebookExtension([line.text])) {
6161
const range = new Range(new Position(line.lineNumber, 0), new Position(line.lineNumber, 1));
62-
command.arguments = [
63-
{ trigger: TensorBoardEntrypointTrigger.nbextension, entrypoint: TensorBoardEntrypoint.codelens },
64-
];
6562
codelenses.push(new CodeLens(range, command));
6663
this.sendTelemetryOnce();
6764
}

src/client/tensorBoard/serviceRegistry.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import { IExtensionSingleActivationService } from '../activation/types';
55
import { IServiceManager } from '../ioc/types';
6-
import { TensorBoardCodeActionProvider } from './tensorBoardCodeActionProvider';
76
import { TensorBoardImportCodeLensProvider } from './tensorBoardImportCodeLensProvider';
87
import { TensorBoardFileWatcher } from './tensorBoardFileWatcher';
98
import { TensorBoardUsageTracker } from './tensorBoardUsageTracker';
@@ -32,9 +31,5 @@ export function registerTypes(serviceManager: IServiceManager): void {
3231
TensorBoardNbextensionCodeLensProvider,
3332
);
3433
serviceManager.addBinding(TensorBoardNbextensionCodeLensProvider, IExtensionSingleActivationService);
35-
serviceManager.addSingleton<IExtensionSingleActivationService>(
36-
IExtensionSingleActivationService,
37-
TensorBoardCodeActionProvider,
38-
);
3934
serviceManager.addSingleton(IExtensionSingleActivationService, TerminalWatcher);
4035
}

src/client/tensorBoard/tensorBoardCodeActionProvider.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/client/tensorBoard/tensorBoardFileWatcher.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import { TensorBoardPrompt } from './tensorBoardPrompt';
1515
export class TensorBoardFileWatcher implements IExtensionSingleActivationService {
1616
private fileSystemWatchers = new Map<WorkspaceFolder, FileSystemWatcher[]>();
1717

18-
private globPattern1 = '*tfevents*';
19-
20-
private globPattern2 = '*/*tfevents*';
18+
private globPatterns = ['*tfevents*', '*/*tfevents*', '*/*/*tfevents*'];
2119

2220
constructor(
2321
@inject(IWorkspaceService) private workspaceService: IWorkspaceService,
@@ -57,7 +55,7 @@ export class TensorBoardFileWatcher implements IExtensionSingleActivationService
5755

5856
private async promptIfWorkspaceHasPreexistingFiles() {
5957
try {
60-
for (const pattern of [this.globPattern1, this.globPattern2]) {
58+
for (const pattern of this.globPatterns) {
6159
const matches = await this.workspaceService.findFiles(pattern, undefined, 1);
6260
if (matches.length > 0) {
6361
await this.tensorBoardPrompt.showNativeTensorBoardPrompt(TensorBoardEntrypointTrigger.tfeventfiles);
@@ -86,7 +84,7 @@ export class TensorBoardFileWatcher implements IExtensionSingleActivationService
8684

8785
private createFileSystemWatcher(folder: WorkspaceFolder) {
8886
const fileWatchers = [];
89-
for (const pattern of [this.globPattern1, this.globPattern2]) {
87+
for (const pattern of this.globPatterns) {
9088
const relativePattern = new RelativePattern(folder, pattern);
9189
const fileSystemWatcher = this.workspaceService.createFileSystemWatcher(relativePattern);
9290

0 commit comments

Comments
 (0)