mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial sets up of new execution plan comparison result endpoint (#18813)
* Initial sets up of new execution plan comparison result endpoint * Makes query execution plan endpoint URI's more consistent.
This commit is contained in:
@@ -1123,7 +1123,16 @@ export interface GetExecutionPlanParams {
|
||||
}
|
||||
|
||||
export namespace GetExecutionPlanRequest {
|
||||
export const type = new RequestType<GetExecutionPlanParams, azdata.executionPlan.GetExecutionPlanResult, void, void>('queryexecutionplan/getexecutionplan');
|
||||
export const type = new RequestType<GetExecutionPlanParams, azdata.executionPlan.GetExecutionPlanResult, void, void>('queryExecutionPlan/getExecutionPlan');
|
||||
}
|
||||
|
||||
export interface ExecutionPlanComparisonParams {
|
||||
firstExecutionPlanGraphInfo: azdata.executionPlan.ExecutionPlanGraphInfo;
|
||||
secondExecutionPlanGraphInfo: azdata.executionPlan.ExecutionPlanGraphInfo;
|
||||
}
|
||||
|
||||
export namespace ExecutionPlanComparisonRequest {
|
||||
export const type = new RequestType<ExecutionPlanComparisonParams, azdata.executionPlan.ExecutionPlanComparisonResult, void, void>('queryExecutionPlan/compareExecutionPlanGraph');
|
||||
}
|
||||
|
||||
// ------------------------------- < Execution Plan > ------------------------------------
|
||||
|
||||
@@ -1221,10 +1221,25 @@ export class ExecutionPlanServiceFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
const compareExecutionPlanGraph = (firstPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo, secondPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo): Thenable<azdata.executionPlan.ExecutionPlanComparisonResult> => {
|
||||
const params: contracts.ExecutionPlanComparisonParams = {
|
||||
firstExecutionPlanGraphInfo: firstPlanFile,
|
||||
secondExecutionPlanGraphInfo: secondPlanFile
|
||||
};
|
||||
|
||||
return client.sendRequest(contracts.ExecutionPlanComparisonRequest.type, params).then(
|
||||
r => r,
|
||||
e => {
|
||||
client.logFailedRequest(contracts.ExecutionPlanComparisonRequest.type, e);
|
||||
return Promise.reject(e);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return azdata.dataprotocol.registerExecutionPlanProvider({
|
||||
providerId: client.providerId,
|
||||
getExecutionPlan
|
||||
getExecutionPlan,
|
||||
compareExecutionPlanGraph
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user