forked from microsoft/azuredatastudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial changes for query store dashboard (microsoft#24272)
* create empty query store dashboard * add placeholder report content * cleanup * more cleanup
- Loading branch information
Showing
8 changed files
with
73 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as vscode from 'vscode'; | ||
import * as azdata from 'azdata'; | ||
import * as constants from '../common/constants'; | ||
import { TopResourceConsumingQueries } from './topResourceConsumingQueries'; | ||
import { OverallResourceConsumption } from './overallResourceConsumption'; | ||
|
||
export class QueryStoreDashboard { | ||
constructor(private dbName: string, private extensionContext: vscode.ExtensionContext) { } | ||
|
||
/** | ||
* Creates and opens the report | ||
*/ | ||
public async open(): Promise<void> { | ||
// TODO: update title based on selected tab to have the current selected report in editor tab title | ||
const dashboard = azdata.window.createModelViewDashboard(constants.queryStoreDashboardTitle(this.dbName)); | ||
dashboard.registerTabs(async (view: azdata.ModelView) => { | ||
const topResourceConsumingQueriesReport = new TopResourceConsumingQueries(this.extensionContext, this.dbName); | ||
const overallResourceConsumptionReport = new OverallResourceConsumption(this.extensionContext, this.dbName); | ||
|
||
await Promise.all([topResourceConsumingQueriesReport.createReport(view), overallResourceConsumptionReport.createReport(view)]); | ||
|
||
const topResourceConsumingQueriesTab: azdata.DashboardTab = { | ||
id: 'TopResourceConsumingQueriesTab', | ||
content: topResourceConsumingQueriesReport.ReportContent!, | ||
title: constants.topResourceConsumingQueries | ||
}; | ||
|
||
const overallResourceConsumptionTab: azdata.DashboardTab = { | ||
id: 'OverallResourceConsumptionTab', | ||
content: overallResourceConsumptionReport.ReportContent!, | ||
title: constants.overallResourceConsumption | ||
}; | ||
|
||
return [ | ||
overallResourceConsumptionTab, | ||
topResourceConsumingQueriesTab | ||
]; | ||
}); | ||
|
||
await dashboard.open(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters