End the current step and record it
(
&mut self,
phase: PlanningPhase,
description: String,
input_plan: Option<PlanSnapshot>,
output_plan: Option<PlanSnapshot>,
cost_estimate: Option<CostE
| 85 | |
| 86 | /// End the current step and record it |
| 87 | pub fn end_step( |
| 88 | &mut self, |
| 89 | phase: PlanningPhase, |
| 90 | description: String, |
| 91 | input_plan: Option<PlanSnapshot>, |
| 92 | output_plan: Option<PlanSnapshot>, |
| 93 | cost_estimate: Option<CostEstimate>, |
| 94 | metadata: TraceMetadata, |
| 95 | ) { |
| 96 | let duration = self |
| 97 | .current_step_start |
| 98 | .map(|start| start.elapsed()) |
| 99 | .unwrap_or_else(|| Duration::from_millis(0)); |
| 100 | |
| 101 | let step = TraceStep { |
| 102 | phase, |
| 103 | description, |
| 104 | duration, |
| 105 | input_plan, |
| 106 | output_plan, |
| 107 | cost_estimate, |
| 108 | metadata, |
| 109 | }; |
| 110 | |
| 111 | self.steps.push(step); |
| 112 | self.current_step_start = None; |
| 113 | } |
| 114 | |
| 115 | /// Finalize the trace with the final plans |
| 116 | pub fn finalize(self, logical_plan: LogicalPlan, physical_plan: PhysicalPlan) -> PlanTrace { |
no test coverage detected