We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f19878 commit 0f32fbfCopy full SHA for 0f32fbf
2 files changed
crates/tako/src/internal/scheduler/query.rs
@@ -10,7 +10,7 @@ struct WorkerTypeState {
10
max: u32,
11
}
12
13
-/* Read the documentation of WorkerTypeQuery in gateway.rs */
+/* Read the documentation of `new_worker_query`` in control.rs */
14
pub(crate) fn compute_new_worker_query(
15
core: &mut Core,
16
queries: &[WorkerTypeQuery],
crates/tako/src/internal/server/workerload.rs
@@ -270,7 +270,11 @@ impl WorkerLoad {
270
pub(crate) fn utilization(&self, wr: &WorkerResources) -> f32 {
271
let mut utilization = 0.0f32;
272
for (n, w) in self.n_resources.iter().zip(wr.n_resources.iter()) {
273
- utilization = utilization.max(n.as_f32() / w.as_f32());
+ utilization = utilization.max(if w.is_zero() {
274
+ 0.0
275
+ } else {
276
+ n.as_f32() / w.as_f32()
277
+ });
278
279
utilization
280
0 commit comments