mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-25 09:35:37 -05:00
Adding node overlays to execution plans (#1451)
* Adding node overlays to execution plans * Adding critical warnings and parallelism * adding critical warning, badge type enum * Renaming badge type class * Adding explicit values to Badge Type
This commit is contained in:
@@ -46,11 +46,46 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
|
||||
Properties = GetProperties(currentNode.Properties),
|
||||
Children = currentNode.Children.Select(x => ConvertShowPlanTreeToExecutionPlanTree(x)).ToList(),
|
||||
Edges = currentNode.Edges.Select(x => ConvertShowPlanEdgeToExecutionPlanEdge(x)).ToList(),
|
||||
Badges = GenerateNodeOverlay(currentNode),
|
||||
Name = currentNode.DisplayName,
|
||||
ElapsedTimeInMs = currentNode.ElapsedTimeInMs
|
||||
};
|
||||
}
|
||||
|
||||
public static List<Badge> GenerateNodeOverlay(Node currentNode)
|
||||
{
|
||||
List<Badge> overlays = new List<Badge>();
|
||||
|
||||
if (currentNode.HasWarnings)
|
||||
{
|
||||
if (currentNode.HasCriticalWarnings)
|
||||
{
|
||||
overlays.Add(new Badge
|
||||
{
|
||||
Type = BadgeType.CRITICALWARNING,
|
||||
Tooltip = SR.WarningOverlayTooltip
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
overlays.Add(new Badge
|
||||
{
|
||||
Type = BadgeType.WARNING,
|
||||
Tooltip = SR.WarningOverlayTooltip
|
||||
});
|
||||
}
|
||||
}
|
||||
if (currentNode.IsParallel)
|
||||
{
|
||||
overlays.Add(new Badge
|
||||
{
|
||||
Type = BadgeType.PARALLELISM,
|
||||
Tooltip = SR.ParallelismOverlayTooltip
|
||||
});
|
||||
}
|
||||
return overlays;
|
||||
}
|
||||
|
||||
public static ExecutionPlanEdges ConvertShowPlanEdgeToExecutionPlanEdge(Edge edge)
|
||||
{
|
||||
return new ExecutionPlanEdges
|
||||
|
||||
Reference in New Issue
Block a user