MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / savings_pct

Method savings_pct

atomic-remote/src/streaming/negotiation.rs:133–139  ·  view source on GitHub ↗

Returns the percentage of bytes saved (0.0 to 100.0).

(&self)

Source from the content-addressed store, hash-verified

131
132 /// Returns the percentage of bytes saved (0.0 to 100.0).
133 pub fn savings_pct(&self) -> f64 {
134 let total = self.bytes_saved + self.bytes_needed;
135 if total == 0 {
136 return 0.0;
137 }
138 self.bytes_saved as f64 / total as f64 * 100.0
139 }
140
141 /// Returns the set of needed chunk hashes.
142 pub fn needed_hashes(&self) -> HashSet<[u8; 32]> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected