mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add guids to RunAll and RunCell events (#17123)
Add guids to RunAll and RunCell events
This commit is contained in:
@@ -375,8 +375,13 @@ export class RunAllCellsAction extends Action {
|
|||||||
}
|
}
|
||||||
public override async run(context: URI): Promise<void> {
|
public override async run(context: URI): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunAll);
|
|
||||||
const editor = this._notebookService.findNotebookEditor(context);
|
const editor = this._notebookService.findNotebookEditor(context);
|
||||||
|
|
||||||
|
const azdata_notebook_guid: string = editor.model.getMetaValue('azdata_notebook_guid');
|
||||||
|
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunAll)
|
||||||
|
.withAdditionalProperties({ azdata_notebook_guid })
|
||||||
|
.send();
|
||||||
|
|
||||||
await editor.runAllCells();
|
await editor.runAllCells();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.notificationService.error(getErrorMessage(e));
|
this.notificationService.error(getErrorMessage(e));
|
||||||
|
|||||||
@@ -189,6 +189,10 @@ suite('Notebook Actions', function (): void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Run All Cells Action', async function (): Promise<void> {
|
test('Run All Cells Action', async function (): Promise<void> {
|
||||||
|
const testNotebookModel = TypeMoq.Mock.ofType<INotebookModel>(NotebookModelStub);
|
||||||
|
testNotebookModel.setup(x => x.getMetaValue(TypeMoq.It.isAny())).returns(() => undefined);
|
||||||
|
mockNotebookEditor.setup(x => x.model).returns(() => testNotebookModel.object);
|
||||||
|
|
||||||
let mockNotification = TypeMoq.Mock.ofType<INotificationService>(TestNotificationService);
|
let mockNotification = TypeMoq.Mock.ofType<INotificationService>(TestNotificationService);
|
||||||
mockNotification.setup(n => n.notify(TypeMoq.It.isAny()));
|
mockNotification.setup(n => n.notify(TypeMoq.It.isAny()));
|
||||||
|
|
||||||
|
|||||||
@@ -561,8 +561,9 @@ export class CellModel extends Disposable implements ICellModel {
|
|||||||
this._outputCounter = 0;
|
this._outputCounter = 0;
|
||||||
// Hide IntelliSense suggestions list when running cell to match SSMS behavior
|
// Hide IntelliSense suggestions list when running cell to match SSMS behavior
|
||||||
this._commandService.executeCommand('hideSuggestWidget');
|
this._commandService.executeCommand('hideSuggestWidget');
|
||||||
|
const azdata_notebook_guid: string = this.notebookModel.getMetaValue('azdata_notebook_guid');
|
||||||
this._telemetryService?.createActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunCell)
|
this._telemetryService?.createActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunCell)
|
||||||
.withAdditionalProperties({ cell_language: kernel.name })
|
.withAdditionalProperties({ cell_language: kernel.name, azdata_cell_guid: this._cellGuid, azdata_notebook_guid })
|
||||||
.send();
|
.send();
|
||||||
// If cell is currently running and user clicks the stop/cancel button, call kernel.interrupt()
|
// If cell is currently running and user clicks the stop/cancel button, call kernel.interrupt()
|
||||||
// This matches the same behavior as JupyterLab
|
// This matches the same behavior as JupyterLab
|
||||||
|
|||||||
Reference in New Issue
Block a user