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

Function progress_reporter_lifecycle

nodedb/src/engine/graph/algo/progress.rs:155–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153
154 #[test]
155 fn progress_reporter_lifecycle() {
156 let mut reporter = ProgressReporter::new(GraphAlgorithm::PageRank, 20, Some(1e-7), 1000);
157
158 reporter.report_iteration(1, Some(0.5));
159 reporter.report_iteration(2, Some(0.01));
160 reporter.report_iteration(3, Some(1e-8));
161
162 let snap = reporter.snapshot(3);
163 assert!(snap.converged);
164 assert_eq!(snap.algorithm, GraphAlgorithm::PageRank);
165 assert_eq!(snap.max_iterations, 20);
166 assert_eq!(snap.nodes_processed, 1000);
167
168 reporter.finish();
169 }
170
171 #[test]
172 fn progress_non_iterative() {

Callers

nothing calls this directly

Calls 3

report_iterationMethod · 0.80
snapshotMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected