Added data points for Table Designer (#18182)

* added server infor and metrics for table designer

* update generate script

* pr comments

* format more files

* pr comments

* make changes to core

* remove unused imports

* add server info

* revert enum change and add publish event

* format doc

* nitpicks

* remove os version

* remove modifier from telemetry info

* remove error message
This commit is contained in:
Aditya Bist
2022-02-02 12:40:05 -08:00
committed by GitHub
parent de1a0f4f0f
commit de5090e47a
14 changed files with 117 additions and 19 deletions

View File

@@ -8,17 +8,21 @@ import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { sqlProviderName } from '../constants';
import { generateUuid } from 'vscode-languageclient/lib/utils/uuid';
import { ITelemetryEventProperties, Telemetry } from '../telemetry';
export function registerTableDesignerCommands(appContext: AppContext) {
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newTable', async (context: azdata.ObjectExplorerContext) => {
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id);
let telemetryInfo: ITelemetryEventProperties = {};
telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo);
await azdata.designers.openTableDesigner(sqlProviderName, {
server: context.connectionProfile.serverName,
database: context.connectionProfile.databaseName,
isNewTable: true,
id: generateUuid(),
connectionString: connectionString
});
}, telemetryInfo);
}));
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.designTable', async (context: azdata.ObjectExplorerContext) => {
@@ -28,6 +32,9 @@ export function registerTableDesignerCommands(appContext: AppContext) {
const name = context.nodeInfo.metadata.name;
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
const connectionUri = await azdata.connection.getUriForConnection(context.connectionProfile.id);
const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id);
let telemetryInfo: ITelemetryEventProperties = {};
telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo);
await azdata.designers.openTableDesigner(sqlProviderName, {
server: server,
database: database,
@@ -36,6 +43,6 @@ export function registerTableDesignerCommands(appContext: AppContext) {
schema: schema,
id: `${connectionUri}|${database}|${schema}|${name}`,
connectionString: connectionString
});
}, telemetryInfo);
}));
}