Skip to content

Commit

Permalink
queryStore WaitStatistics options should be a dropdown #24372
Browse files Browse the repository at this point in the history
  • Loading branch information
ssreerama committed Sep 11, 2023
1 parent 5c42313 commit 544c33e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions extensions/mssql/src/objectManagement/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo<Databa
azureMaxSizes?: AzureEditionDetails[];
pageVerifyOptions?: string[];
restrictAccessOptions?: string[];
dscOnOffOptions?: string[];
propertiesOnOffOptions?: string[];
dscElevateOptions?: string[];
dscEnableDisableOptions?: string[];
rowDataFileGroupsOptions?: string[];
Expand All @@ -498,7 +498,7 @@ export interface QueryStoreOptions {
queryStoreCaptureMode: string;
sizeBasedCleanupMode: string;
staleQueryThresholdInDays: number;
waitStatisticsCaptureMode?: boolean;
waitStatisticsCaptureMode?: string;
capturePolicyOptions?: QueryStoreCapturePolicyOptions;
currentStorageSizeInMB: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export class TestObjectManagementService implements IObjectManagementService {
pageVerifyOptions: ['CHECKSUM', 'NONE', 'TORN_PAGE_DETECTION'],
dscElevateOptions: ['OFF', 'WHEN_SUPPORTED', 'FAIL_UNSUPPORTED'],
dscEnableDisableOptions: ['ENABLED', 'DISABLED'],
dscOnOffOptions: ['ON', 'OFF'],
propertiesOnOffOptions: ['ON', 'OFF'],
rowDataFileGroupsOptions: ['PRIMARY', 'RowDataGroup1', 'RowDataGroup2'],
fileStreamFileGroupsOptions: ['PRIMARY', 'FileStreamGroup1', 'FileStreamGroup2'],
fileTypesOptions: ['ROWS', 'LOG', 'FILESTREAM'],
Expand Down
30 changes: 15 additions & 15 deletions extensions/mssql/src/objectManagement/ui/databaseDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas
private queryStoreCaptureMode: azdata.DropDownComponent;
private sizeBasedCleanupMode: azdata.DropDownComponent;
private stateQueryThresholdInDays: azdata.InputBoxComponent;
private waitStatisticsCaptureMode: azdata.CheckBoxComponent;
private waitStatisticsCaptureMode: azdata.DropDownComponent;
private executionCount: azdata.InputBoxComponent;
private staleThreshold: azdata.DropDownComponent;
private totalCompileCPUTimeInMS: azdata.InputBoxComponent;
Expand Down Expand Up @@ -1386,18 +1386,18 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas
// Can only set OFF/Azure blob storage endpoint to the 'LEDGER_DIGEST_STORAGE_ENDPOINT (38)'s primary and secondary values
else if (this.currentRowObjectInfo.id === 38) {
await this.showDropdownsSection(isSecondaryCheckboxChecked);
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify([this.viewInfo.dscOnOffOptions[1]]) ||
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify([this.viewInfo.propertiesOnOffOptions[1]]) ||
this.valueForPrimaryDropdown.value !== this.currentRowObjectInfo.valueForPrimary) {
await this.valueForPrimaryDropdown.updateProperties({
values: [this.viewInfo.dscOnOffOptions[1]] // Only OFF is allowed for primary value
values: [this.viewInfo.propertiesOnOffOptions[1]] // Only OFF is allowed for primary value
, value: this.currentRowObjectInfo.valueForPrimary
, editable: true // This is to allow the user to enter the Azure blob storage endpoint
});
}
if (JSON.stringify(this.valueForSecondaryDropdown.values) !== JSON.stringify([this.viewInfo.dscOnOffOptions[1]]) ||
if (JSON.stringify(this.valueForSecondaryDropdown.values) !== JSON.stringify([this.viewInfo.propertiesOnOffOptions[1]]) ||
this.valueForSecondaryDropdown.value !== this.currentRowObjectInfo.valueForSecondary) {
await this.valueForSecondaryDropdown.updateProperties({
values: [this.viewInfo.dscOnOffOptions[1]] // Only OFF is allowed for secondary value
values: [this.viewInfo.propertiesOnOffOptions[1]] // Only OFF is allowed for secondary value
, value: this.currentRowObjectInfo.valueForSecondary
, editable: true // This is to allow the user to enter the Azure blob storage endpoint
});
Expand All @@ -1407,10 +1407,10 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas
// Cannot set the 'GLOBAL_TEMPORARY_TABLE_AUTO_DROP (21)' option for the secondaries replica while this option is only allowed to be set for the primary.
else if (this.currentRowObjectInfo.id === 6 || this.currentRowObjectInfo.id === 21) {
await this.dscPrimaryValueDropdownGroup.updateCssStyles({ 'visibility': 'visible' });
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify(this.viewInfo.dscOnOffOptions) ||
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify(this.viewInfo.propertiesOnOffOptions) ||
this.valueForPrimaryDropdown.value !== this.currentRowObjectInfo.valueForPrimary) {
await this.valueForPrimaryDropdown.updateProperties({
values: this.viewInfo.dscOnOffOptions
values: this.viewInfo.propertiesOnOffOptions
, value: this.currentRowObjectInfo.valueForPrimary
});
}
Expand All @@ -1436,17 +1436,17 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas
// All other options accepts primary and seconday values as ON/OFF/PRIMARY(only secondary)
else {
await this.showDropdownsSection(isSecondaryCheckboxChecked);
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify(this.viewInfo.dscOnOffOptions) ||
if (JSON.stringify(this.valueForPrimaryDropdown.values) !== JSON.stringify(this.viewInfo.propertiesOnOffOptions) ||
this.valueForPrimaryDropdown.value !== this.currentRowObjectInfo.valueForPrimary) {
await this.valueForPrimaryDropdown.updateProperties({
values: this.viewInfo.dscOnOffOptions
values: this.viewInfo.propertiesOnOffOptions
, value: this.currentRowObjectInfo.valueForPrimary
});
}
if (JSON.stringify(this.valueForSecondaryDropdown.values) !== JSON.stringify(this.viewInfo.dscOnOffOptions) ||
if (JSON.stringify(this.valueForSecondaryDropdown.values) !== JSON.stringify(this.viewInfo.propertiesOnOffOptions) ||
this.valueForSecondaryDropdown.value !== this.currentRowObjectInfo.valueForSecondary) {
await this.valueForSecondaryDropdown.updateProperties({
values: this.viewInfo.dscOnOffOptions
values: this.viewInfo.propertiesOnOffOptions
, value: this.currentRowObjectInfo.valueForSecondary
});
}
Expand Down Expand Up @@ -1726,10 +1726,10 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas

// Wait Statistics Capture Mode - supported from 2017 or higher
if (!isUndefinedOrNull(this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode)) {
this.waitStatisticsCaptureMode = this.createCheckbox(localizedConstants.WaitStatisticsCaptureModeText, async (checked) => {
this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode = checked;
}, this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode, this.areQueryStoreOptionsEnabled);
containers.push(this.waitStatisticsCaptureMode);
this.waitStatisticsCaptureMode = this.createDropdown(localizedConstants.WaitStatisticsCaptureModeText, async (newValue) => {
this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode = newValue as string;
}, this.viewInfo.propertiesOnOffOptions, this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode.toUpperCase(), this.areQueryStoreOptionsEnabled, DefaultInputWidth);
containers.push(this.createLabelInputContainer(localizedConstants.WaitStatisticsCaptureModeText, this.waitStatisticsCaptureMode));
}
const retentionSection = this.createGroup(localizedConstants.WaitStatisticsCaptureModeText, containers, true);
this.queryStoreTabSectionsContainer.push(retentionSection);
Expand Down

0 comments on commit 544c33e

Please sign in to comment.