Report algorithm completion.
(&self)
| 126 | |
| 127 | /// Report algorithm completion. |
| 128 | pub fn finish(&self) { |
| 129 | let elapsed_ms = self.start.elapsed().as_millis() as u64; |
| 130 | let converged = match (self.last_delta, self.tolerance) { |
| 131 | (Some(delta), Some(tol)) => delta < tol, |
| 132 | _ => true, // non-iterative algorithms are always "converged" |
| 133 | }; |
| 134 | tracing::info!( |
| 135 | algorithm = self.algorithm.name(), |
| 136 | elapsed_ms, |
| 137 | converged, |
| 138 | final_delta = self.last_delta.unwrap_or(0.0), |
| 139 | node_count = self.node_count, |
| 140 | "graph algorithm completed" |
| 141 | ); |
| 142 | } |
| 143 | |
| 144 | /// Total elapsed time since start. |
| 145 | pub fn elapsed_ms(&self) -> u64 { |