mirror of
https://github.com/Microsoft/vscode
synced 2024-06-30 23:04:56 +00:00
add telemetry to give insight for experiment (#212401)
* add telemetry to give insight for experiment * conventional event name, skip for cancellation
This commit is contained in:
parent
dc7a2cd4d7
commit
c5e287efea
|
@ -15,6 +15,7 @@ import { assertType } from 'vs/base/common/types';
|
|||
import { URI } from 'vs/base/common/uri';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWriteFileOptions, IFileStatWithMetadata } from 'vs/platform/files/common/files';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IRevertOptions, ISaveOptions, IUntypedEditorInput } from 'vs/workbench/common/editor';
|
||||
import { EditorModel } from 'vs/workbench/common/editor/editorModel';
|
||||
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
|
||||
|
@ -241,8 +242,30 @@ export class NotebookFileWorkingCopyModel extends Disposable implements IStoredF
|
|||
throw new CancellationError();
|
||||
}
|
||||
|
||||
const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token);
|
||||
return stat;
|
||||
try {
|
||||
const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token);
|
||||
return stat;
|
||||
} catch (error) {
|
||||
if (!token.isCancellationRequested) {
|
||||
type notebookSaveErrorData = {
|
||||
isRemote: boolean;
|
||||
versionMismatch: boolean;
|
||||
};
|
||||
type notebookSaveErrorClassification = {
|
||||
owner: 'amunger';
|
||||
comment: 'Detect if we are having issues saving a notebook on the Extension Host';
|
||||
isRemote: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Whether the save is happening on a remote file system' };
|
||||
versionMismatch: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'If the error was because of a version mismatch' };
|
||||
};
|
||||
const telemetry = {} as ITelemetryService;
|
||||
telemetry.publicLogError2<notebookSaveErrorData, notebookSaveErrorClassification>('notebook/SaveError', {
|
||||
isRemote: this._notebookModel.uri.scheme === Schemas.vscodeRemote,
|
||||
versionMismatch: error instanceof Error && error.message === 'Document version mismatch'
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user