mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Profiler toolbar changes (#1615)
* Clear event view pane when starting new session * Removing debug logging * Handling pause button * Cleaning up comments from previous commit * Fixing comments from PR * Fixing a comment I forgot to delete * Bumping dataprotocolclient version * Bumping sqltoolsservice & sqlops-dataprotocolclient version
This commit is contained in:
committed by
GitHub
parent
8e72fdaa52
commit
af2bc859d1
@@ -658,7 +658,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.7",
|
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.1.8.2",
|
||||||
"opener": "^1.4.3",
|
"opener": "^1.4.3",
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
|
||||||
"vscode-extension-telemetry": "^0.0.15"
|
"vscode-extension-telemetry": "^0.0.15"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "1.4.0-alpha.35",
|
"version": "1.4.0-alpha.44",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-netcoreapp2.1.zip",
|
"Windows_86": "win-x86-netcoreapp2.1.zip",
|
||||||
"Windows_64": "win-x64-netcoreapp2.1.zip",
|
"Windows_64": "win-x64-netcoreapp2.1.zip",
|
||||||
|
|||||||
@@ -92,33 +92,6 @@ const profilerSessionTemplateSchema: IJSONSchema = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TSQL'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Blank'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'SP_Counts'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TQL_Duration'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TSQL_Grouped'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TSQL_Locks'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TSQL_Replay'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TSQL_SPs'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tuning'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export class ProfilerConnect extends Action {
|
|||||||
public set connected(value: boolean) {
|
public set connected(value: boolean) {
|
||||||
this._connected = value;
|
this._connected = value;
|
||||||
this._setClass(value ? 'disconnect' : 'connect');
|
this._setClass(value ? 'disconnect' : 'connect');
|
||||||
this._setLabel(value ? nls.localize('profilerAction.disconnect', 'Disconnected') : nls.localize('profilerAction.connect', "Connect"));
|
this._setLabel(value ? nls.localize('profilerAction.disconnect', 'Disconnect') : nls.localize('profilerAction.connect', "Connect"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public get connected(): boolean {
|
public get connected(): boolean {
|
||||||
@@ -78,17 +78,19 @@ export class ProfilerStart extends Action {
|
|||||||
|
|
||||||
public run(input: ProfilerInput): TPromise<boolean> {
|
public run(input: ProfilerInput): TPromise<boolean> {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
|
input.data.clear();
|
||||||
return TPromise.wrap(this._profilerService.startSession(input.id).then(() => {
|
return TPromise.wrap(this._profilerService.startSession(input.id).then(() => {
|
||||||
input.state.change({ isRunning: true, isStopped: false, isPaused: false });
|
input.state.change({ isRunning: true, isStopped: false, isPaused: false });
|
||||||
return true;
|
return true;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ProfilerPause extends Action {
|
export class ProfilerPause extends Action {
|
||||||
public static ID = 'profiler.pause';
|
public static ID = 'profiler.pause';
|
||||||
public static LABEL = nls.localize('pause', "Pause");
|
public static LABEL = nls.localize('profiler.capture', "Pause Capture");
|
||||||
|
|
||||||
|
private _paused: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
id: string, label: string,
|
id: string, label: string,
|
||||||
@@ -98,12 +100,22 @@ export class ProfilerPause extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public run(input: ProfilerInput): TPromise<boolean> {
|
public run(input: ProfilerInput): TPromise<boolean> {
|
||||||
this.enabled = false;
|
|
||||||
return TPromise.wrap(this._profilerService.pauseSession(input.id).then(() => {
|
return TPromise.wrap(this._profilerService.pauseSession(input.id).then(() => {
|
||||||
input.state.change({ isPaused: true, isStopped: false, isRunning: false });
|
this.paused = !this._paused;
|
||||||
|
input.state.change({ isPaused: this.paused, isStopped: false, isRunning: !this.paused });
|
||||||
return true;
|
return true;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public set paused(value: boolean) {
|
||||||
|
this._paused = value;
|
||||||
|
this._setClass(value ? 'start' : 'stop');
|
||||||
|
this._setLabel(value ? nls.localize('profilerAction.resumeCapture', "Resume Capture") : nls.localize('profilerAction.pauseCapture', "Pause Capture"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public get paused(): boolean {
|
||||||
|
return this._paused;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ProfilerStop extends Action {
|
export class ProfilerStop extends Action {
|
||||||
|
|||||||
@@ -202,15 +202,15 @@ export class ProfilerEditor extends BaseEditor {
|
|||||||
this._register(attachSelectBoxStyler(this._sessionTemplateSelector, this.themeService));
|
this._register(attachSelectBoxStyler(this._sessionTemplateSelector, this.themeService));
|
||||||
|
|
||||||
this._actionBar.setContent([
|
this._actionBar.setContent([
|
||||||
{ action: this._startAction },
|
|
||||||
{ action: this._pauseAction },
|
|
||||||
{ action: this._stopAction },
|
|
||||||
{ action: this._connectAction },
|
{ action: this._connectAction },
|
||||||
{ element: Taskbar.createTaskbarSeparator() },
|
{ element: Taskbar.createTaskbarSeparator() },
|
||||||
{ action: this._autoscrollAction },
|
{ action: this._startAction },
|
||||||
{ action: this._instantiationService.createInstance(Actions.ProfilerClear, Actions.ProfilerClear.ID, Actions.ProfilerClear.LABEL) },
|
{ action: this._stopAction },
|
||||||
{ element: dropdownContainer },
|
{ element: dropdownContainer },
|
||||||
{ action: this._instantiationService.createInstance(Actions.ProfilerEditColumns, Actions.ProfilerEditColumns.ID, Actions.ProfilerEditColumns.LABEL) }
|
{ element: Taskbar.createTaskbarSeparator() },
|
||||||
|
{ action: this._pauseAction },
|
||||||
|
{ action: this._autoscrollAction },
|
||||||
|
{ action: this._instantiationService.createInstance(Actions.ProfilerClear, Actions.ProfilerClear.ID, Actions.ProfilerClear.LABEL) }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,16 +397,14 @@ export class ProfilerEditor extends BaseEditor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.isRunning) {
|
if (e.isPaused){
|
||||||
this._startAction.enabled = !this.input.state.isRunning;
|
this._pauseAction.paused = this.input.state.isPaused;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.isStopped || e.isRunning) {
|
if (e.isStopped || e.isRunning) {
|
||||||
this._stopAction.enabled = !this.input.state.isStopped && this.input.state.isRunning;
|
this._startAction.enabled = !this.input.state.isRunning && !this.input.state.isPaused;
|
||||||
}
|
this._stopAction.enabled = !this.input.state.isStopped && (this.input.state.isRunning || this.input.state.isPaused);
|
||||||
|
this._pauseAction.enabled = !this.input.state.isStopped && (this.input.state.isRunning || this.input.state.isPaused);
|
||||||
if (e.isPaused || e.isRunning) {
|
|
||||||
this._pauseAction.enabled = !this.input.state.isPaused && this.input.state.isRunning;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -503,6 +503,14 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
|||||||
return this._resolveProvider<sqlops.ProfilerProvider>(handle).stopSession(sessionId);
|
return this._resolveProvider<sqlops.ProfilerProvider>(handle).stopSession(sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pause a profiler session
|
||||||
|
*/
|
||||||
|
public $pauseSession(handle: number, sessionId: string): Thenable<boolean> {
|
||||||
|
return this._resolveProvider<sqlops.ProfilerProvider>(handle).pauseSession(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Profiler session events available notification
|
* Profiler session events available notification
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
|||||||
return self._proxy.$stopSession(handle, sessionId);
|
return self._proxy.$stopSession(handle, sessionId);
|
||||||
},
|
},
|
||||||
pauseSession(sessionId: string): Thenable<boolean> {
|
pauseSession(sessionId: string): Thenable<boolean> {
|
||||||
return TPromise.as(true);
|
return self._proxy.$pauseSession(handle, sessionId);
|
||||||
},
|
},
|
||||||
connectSession(sessionId: string): Thenable<boolean> {
|
connectSession(sessionId: string): Thenable<boolean> {
|
||||||
return TPromise.as(true);
|
return TPromise.as(true);
|
||||||
|
|||||||
@@ -313,6 +313,11 @@ export abstract class ExtHostDataProtocolShape {
|
|||||||
*/
|
*/
|
||||||
$stopSession(handle: number, sessionId: string): Thenable<boolean> { throw ni(); }
|
$stopSession(handle: number, sessionId: string): Thenable<boolean> { throw ni(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pause a profiler session
|
||||||
|
*/
|
||||||
|
$pauseSession(handle: number, sessionId: string): Thenable<boolean> { throw ni(); }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Agent Job list
|
* Get Agent Job list
|
||||||
|
|||||||
Reference in New Issue
Block a user