Per-shard predicted full STEPS (floor + member step-cost + cross-ingress), indexed by shard id, from a built manifest and its block assignment.
( profile: &BlockProfile, shard_of: &[u32], manifest: &ShardManifest, )
| 1730 | fbytes[src] += f64::from(size(b)); |
| 1731 | } |
| 1732 | *e = src_consumers; |
| 1733 | } |
| 1734 | if fcnt[dst].remove(&b).is_some() { |
| 1735 | fbytes[dst] -= f64::from(size(b)); |
| 1736 | } |
| 1737 | moves += 1; |
| 1738 | } |
| 1739 | moves |
| 1740 | } |
| 1741 | |
| 1742 | /// Predicted per-shard costs under the static model for a given assignment |
| 1743 | /// (fresh recomputation — used for reports and tests). |
| 1744 | pub fn static_predicted_costs( |
| 1745 | profile: &BlockProfile, |
| 1746 | shard_of: &[u32], |
| 1747 | num_shards: usize, |
| 1748 | ) -> Vec<f64> { |
| 1749 | use rustc_hash::FxHashMap; |
| 1750 | let mut owned = vec![0.0f64; num_shards]; |
| 1751 | let mut fr: Vec<FxHashMap<u32, ()>> = vec![FxHashMap::default(); num_shards]; |
| 1752 | for b in 0..profile.num_blocks() as u32 { |
no test coverage detected