Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions python/ray/serve/_private/autoscaling_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def register(self, info: DeploymentInfo, curr_target_num_replicas: int) -> int:
self._target_capacity_direction = info.target_capacity_direction
self._policy_state = {}

# Log when custom autoscaling policy is used for deployment
if not self._config.policy.is_default_policy_function():
logger.info(
f"Using custom autoscaling policy '{self._config.policy.policy_function}' "
f"for deployment '{self._deployment_id}'."
)

return self.apply_bounds(target_num_replicas)

def on_replica_stopped(self, replica_id: ReplicaID):
Expand Down Expand Up @@ -672,6 +679,13 @@ def register(
self._policy = autoscaling_policy.get_policy()
self._policy_state = {}

# Log when custom autoscaling policy is used for application
if not autoscaling_policy.is_default_policy_function():
logger.info(
f"Using custom autoscaling policy '{autoscaling_policy.policy_function}' "
f"for application '{self._app_name}'."
)

def has_policy(self) -> bool:
return self._policy is not None

Expand Down