Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
use team instead of pool_owner for emitted metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Max Falk <[email protected]>
  • Loading branch information
gmdfalk committed Oct 12, 2023
1 parent ffc4439 commit 987f308
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/autoscaler/autoscaler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ def test_autoscaler_run(dry_run, mock_autoscaler, run_timestamp):
mock_autoscaler.run(dry_run=dry_run, timestamp=run_timestamp)

assert mock_autoscaler.target_capacity_gauge.set.call_args == mock.call(
100, {"dry_run": dry_run, "alert_on_max_capacity": True, "pool_owner": "compute_infra"}
100, {"dry_run": dry_run, "alert_on_max_capacity": True, "team": "compute_infra"}
)
assert mock_autoscaler.max_capacity_gauge.set.call_args == mock.call(
mock_autoscaler.pool_manager.max_capacity,
{"dry_run": dry_run, "alert_on_max_capacity": True, "pool_owner": "compute_infra"},
{"dry_run": dry_run, "alert_on_max_capacity": True, "team": "compute_infra"},
)
assert mock_autoscaler.setpoint_gauge.set.call_args == mock.call(
0.7, {"dry_run": dry_run, "alert_on_max_capacity": True, "pool_owner": "compute_infra"}
0.7, {"dry_run": dry_run, "alert_on_max_capacity": True, "team": "compute_infra"}
)
assert mock_autoscaler._compute_target_capacity.call_args == mock.call(resource_request)
assert mock_autoscaler.pool_manager.modify_target_capacity.call_count == 1

assert mock_autoscaler.resource_request_gauges["cpus"].set.call_args == mock.call(
resource_request.cpus,
{"dry_run": dry_run, "alert_on_max_capacity": True, "pool_owner": "compute_infra"},
{"dry_run": dry_run, "alert_on_max_capacity": True, "team": "compute_infra"},
)
assert mock_autoscaler.resource_request_gauges["mem"].set.call_count == 0
assert mock_autoscaler.resource_request_gauges["disk"].set.call_count == 0
Expand Down

0 comments on commit 987f308

Please sign in to comment.