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:
Lewis Sanchez
2022-03-25 11:47:46 -07:00
committed by GitHub
parent 0d3cec074d
commit 85b4bf13f9
7 changed files with 85 additions and 3 deletions

View File

@@ -933,4 +933,8 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
public override $getExecutionPlan(handle: number, planFile: azdata.executionPlan.ExecutionPlanGraphInfo): Thenable<azdata.executionPlan.GetExecutionPlanResult> {
return this._resolveProvider<azdata.executionPlan.ExecutionPlanProvider>(handle).getExecutionPlan(planFile);
}
public override $compareExecutionPlanGraph(handle: number, firstPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo, secondPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo): Thenable<azdata.executionPlan.ExecutionPlanComparisonResult> {
return this._resolveProvider<azdata.executionPlan.ExecutionPlanProvider>(handle).compareExecutionPlanGraph(firstPlanFile, secondPlanFile);
}
}

View File

@@ -572,6 +572,10 @@ export abstract class ExtHostDataProtocolShape {
* Gets the generic execution plan graph for a plan file.
*/
$getExecutionPlan(handle: number, planFile: azdata.executionPlan.ExecutionPlanGraphInfo): Thenable<azdata.executionPlan.GetExecutionPlanResult> { throw ni(); }
/**
* Compares two execution plans and identifies matching sections in both.
*/
$compareExecutionPlanGraph(handle: number, firstPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo, secondPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo): Thenable<azdata.executionPlan.ExecutionPlanComparisonResult> { throw ni(); }
}
/**

View File

@@ -123,6 +123,12 @@ export class ExecutionPlanService implements IExecutionPlanService {
});
}
compareExecutionPlanGraph(firstPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo, secondPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo): Promise<azdata.executionPlan.ExecutionPlanComparisonResult> {
return this._runAction(firstPlanFile.graphFileType, (runner) => {
return runner.compareExecutionPlanGraph(firstPlanFile, secondPlanFile);
});
}
getSupportedExecutionPlanExtensionsForProvider(providerId: string): string[] | undefined {
return this._capabilitiesService.getCapabilities(providerId).connection.supportedExecutionPlanFileExtensions;
}

View File

@@ -22,6 +22,12 @@ export interface IExecutionPlanService {
* Gets an execution plan for the given planFile.
*/
getExecutionPlan(planFile: azdata.executionPlan.ExecutionPlanGraphInfo): Promise<azdata.executionPlan.GetExecutionPlanResult>;
/**
* Compares two execution plans and identifies matching regions in both execution plans.
* @param firstPlanFile file that contains the first execution plan.
* @param secondPlanFile file that contains the second execution plan.
*/
compareExecutionPlanGraph(firstPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo, secondPlanFile: azdata.executionPlan.ExecutionPlanGraphInfo): Promise<azdata.executionPlan.ExecutionPlanComparisonResult>;
/**
* Get execution plan file extensions supported by the provider.