mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
Adding Assessment Telemetry in SQL Migration (#15935)
* Adding telemetry for assessment * Removing dms loading fix * Fixing PR * removing collection of account id * moving database warning count to the server assessment event * Removing individual warning and issue events * Adding aggregates for database issues and warnings * removing extra line * Adding other telemetry events in sql migration * Fixed changes made in the PR * Fixing attribute names * Consolidating issues and errors in 1 event * Converting dependencies to dev depenedencies * Adding a catch for the telemetry function * moving the non type uuid to non dev * Made hashmap code cleaner * Fixing cutover start time * Fixing object creation * Reverting back to old method. * Modifying the date time to js objects * Converting issues and warnings to json object
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { getMigrationStatus, DatabaseMigration, startMigrationCutover, stopMigration, getMigrationAsyncOperationDetails, AzureAsyncOperationResource } from '../../api/azure';
|
||||
import { MigrationContext } from '../../models/migrationLocalStorage';
|
||||
import { sendSqlMigrationActionEvent, TelemetryAction, TelemetryViews } from '../../telemtery';
|
||||
|
||||
export enum MigrationStatus {
|
||||
Failed = 'Failed',
|
||||
@@ -34,6 +35,16 @@ export class MigrationCutoverDialogModel {
|
||||
this._migration.subscription,
|
||||
this._migration.migrationContext
|
||||
));
|
||||
|
||||
sendSqlMigrationActionEvent(
|
||||
TelemetryViews.MigrationCutoverDialog,
|
||||
TelemetryAction.MigrationStatus,
|
||||
{
|
||||
'sessionId': this._migration.sessionId!,
|
||||
'migrationStatus': this.migrationStatus.properties.migrationStatus
|
||||
},
|
||||
{}
|
||||
);
|
||||
// Logging status to help debugging.
|
||||
console.log(this.migrationStatus);
|
||||
}
|
||||
@@ -41,11 +52,21 @@ export class MigrationCutoverDialogModel {
|
||||
public async startCutover(): Promise<DatabaseMigration | undefined> {
|
||||
try {
|
||||
if (this.migrationStatus) {
|
||||
return await startMigrationCutover(
|
||||
const cutover = await startMigrationCutover(
|
||||
this._migration.azureAccount,
|
||||
this._migration.subscription,
|
||||
this.migrationStatus
|
||||
);
|
||||
sendSqlMigrationActionEvent(
|
||||
TelemetryViews.MigrationCutoverDialog,
|
||||
TelemetryAction.CutoverMigration,
|
||||
{
|
||||
'sessionId': this._migration.sessionId!,
|
||||
'migrationEndTime': new Date().toString()
|
||||
},
|
||||
{}
|
||||
);
|
||||
return cutover;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -56,11 +77,21 @@ export class MigrationCutoverDialogModel {
|
||||
public async cancelMigration(): Promise<void> {
|
||||
try {
|
||||
if (this.migrationStatus) {
|
||||
const cutoverStartTime = new Date().toString();
|
||||
await stopMigration(
|
||||
this._migration.azureAccount,
|
||||
this._migration.subscription,
|
||||
this.migrationStatus
|
||||
);
|
||||
sendSqlMigrationActionEvent(
|
||||
TelemetryViews.MigrationCutoverDialog,
|
||||
TelemetryAction.CancelMigration,
|
||||
{
|
||||
'sessionId': this._migration.sessionId!,
|
||||
'cutoverStartTime': cutoverStartTime
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
Reference in New Issue
Block a user