MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / snapshot

Method snapshot

nodedb/src/engine/graph/algo/progress.rs:110–125  ·  view source on GitHub ↗

Build a progress snapshot for the current state.

(&self, iteration: usize)

Source from the content-addressed store, hash-verified

108
109 /// Build a progress snapshot for the current state.
110 pub fn snapshot(&self, iteration: usize) -> AlgoProgress {
111 let converged = match (self.last_delta, self.tolerance) {
112 (Some(delta), Some(tol)) => delta < tol,
113 _ => false,
114 };
115 AlgoProgress {
116 algorithm: self.algorithm,
117 iteration,
118 max_iterations: self.max_iterations,
119 convergence_delta: self.last_delta,
120 tolerance: self.tolerance,
121 elapsed_ms: self.start.elapsed().as_millis() as u64,
122 nodes_processed: self.node_count,
123 converged,
124 }
125 }
126
127 /// Report algorithm completion.
128 pub fn finish(&self) {

Callers 3

progress_non_iterativeFunction · 0.45
progress_not_convergedFunction · 0.45

Calls 2

elapsedMethod · 0.80
as_millisMethod · 0.45

Tested by 3

progress_non_iterativeFunction · 0.36
progress_not_convergedFunction · 0.36