@@ -403,18 +403,6 @@ def _update(self):
403
403
# This will accumulate the nodes we need to terminate.
404
404
self .nodes_to_terminate = []
405
405
406
- # Update running nodes gauge
407
- num_workers = len (self .non_terminated_nodes .worker_ids )
408
- self .prom_metrics .running_workers .set (num_workers )
409
-
410
- # Remove from LoadMetrics the ips unknown to the NodeProvider.
411
- self .load_metrics .prune_active_ips (
412
- active_ips = [
413
- self .provider .internal_ip (node_id )
414
- for node_id in self .non_terminated_nodes .all_node_ids
415
- ]
416
- )
417
-
418
406
# Update status strings
419
407
if AUTOSCALER_STATUS_LOG :
420
408
logger .info (self .info_string ())
@@ -437,6 +425,18 @@ def _update(self):
437
425
self .attempt_to_recover_unhealthy_nodes (now )
438
426
self .set_prometheus_updater_data ()
439
427
428
+ # Update running nodes gauge
429
+ num_workers = len (self .non_terminated_nodes .worker_ids )
430
+ self .prom_metrics .running_workers .set (num_workers )
431
+
432
+ # Remove IPs from LoadMetrics that are not known to the NodeProvider.
433
+ self .load_metrics .prune_active_ips (
434
+ active_ips = [
435
+ self .provider .internal_ip (node_id )
436
+ for node_id in self .non_terminated_nodes .all_node_ids
437
+ ]
438
+ )
439
+
440
440
# Dict[NodeType, int], List[ResourceDict]
441
441
to_launch , unfulfilled = self .resource_demand_scheduler .get_nodes_to_launch (
442
442
self .non_terminated_nodes .all_node_ids ,
0 commit comments