mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial improvement in sp_whoisactive (#1249)
* improve sp_whoisactive extension * formatting * use a grouping prefix for extension commands
This commit is contained in:
@@ -29,23 +29,16 @@ export default class MainController extends ControllerBase {
|
||||
}
|
||||
|
||||
public activate(): Promise<boolean> {
|
||||
sqlops.dashboard.registerWebviewProvider('sp_whoisactive_documentation', webview => {
|
||||
let templateValues = {url: 'http://whoisactive.com/docs/'};
|
||||
Utils.renderTemplateHtml(path.join(__dirname, '..'), 'templateTab.html', templateValues)
|
||||
.then(html => {
|
||||
webview.html = html;
|
||||
});
|
||||
});
|
||||
|
||||
sqlops.tasks.registerTask('sp_whoisactive.install', e => this.onInstall(e));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.install', e => this.openurl('http://whoisactive.com/downloads/'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.documentation', e => this.openurl('http://whoisactive.com/docs/'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.findBlockLeaders', e => this.onExecute(e, 'findBlockLeaders.sql'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.getPlans', e => this.onExecute(e, 'getPlans.sql'));
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
private onInstall(connection: sqlops.IConnectionProfile): void {
|
||||
openurl.open('http://whoisactive.com/downloads/');
|
||||
private openurl(link: string): void {
|
||||
openurl.open(link);
|
||||
}
|
||||
|
||||
private onExecute(connection: sqlops.IConnectionProfile, fileName: string): void {
|
||||
|
||||
4
samples/sp_whoIsActive/src/sql/blockingSessions.sql
Normal file
4
samples/sp_whoIsActive/src/sql/blockingSessions.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
SELECT blocking_session_id
|
||||
FROM sys.dm_os_waiting_tasks
|
||||
WHERE
|
||||
blocking_session_id IS NOT NULL
|
||||
Reference in New Issue
Block a user