RecommendedShardCount is the raw autosizing formula: K = clamp(ceil(H / hrTargetPerShard), 1, min(maxAutoShards, T)).
(helmReleases, tenants int)
| 216 | // RecommendedShardCount is the raw autosizing formula: |
| 217 | // K = clamp(ceil(H / hrTargetPerShard), 1, min(maxAutoShards, T)). |
| 218 | func RecommendedShardCount(helmReleases, tenants int) int { |
| 219 | k := (helmReleases + hrTargetPerShard - 1) / hrTargetPerShard |
| 220 | if k < 1 { |
| 221 | k = 1 |
| 222 | } |
| 223 | limit := maxAutoShards |
| 224 | if tenants > 0 && tenants < limit { |
| 225 | limit = tenants |
| 226 | } |
| 227 | if k > limit { |
| 228 | k = limit |
| 229 | } |
| 230 | return k |
| 231 | } |
| 232 | |
| 233 | // EffectiveShardCount resolves the shard count for this sync. Explicit |
| 234 | // configuration wins; in auto mode the recommendation is applied with |
no outgoing calls