Skip to content

Commit

Permalink
add _TEST_METRIC_NAME_CPU_UTILIZATION and _TEST_METRIC_NAME_GPU_UTILI…
Browse files Browse the repository at this point in the history
…ZATION
  • Loading branch information
munagekar committed May 17, 2022
1 parent c82ba65 commit e14d1ae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/unit/aiplatform/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
_TEST_ACCELERATOR_TYPE = "NVIDIA_TESLA_P100"
_TEST_ACCELERATOR_COUNT = 2

_TEST_METRIC_NAME_CPU_UTILIZATION = "aiplatform.googleapis.com/prediction/online/cpu/utilization"
_TEST_METRIC_NAME_GPU_UTILIZATION = "aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle"

_TEST_EXPLANATIONS = [gca_prediction_service.explanation.Explanation(attributions=[])]

_TEST_ATTRIBUTIONS = [
Expand Down Expand Up @@ -1082,8 +1085,8 @@ def test_deploy_with_autoscaling_target_cpu_utilization(self, deploy_model_mock,
)

expected_autoscaling_metric_spec = gca_machine_resources.AutoscalingMetricSpec(
metric_name="aiplatform.googleapis.com/prediction/online/cpu/utilization",
target=70
metric_name=_TEST_METRIC_NAME_CPU_UTILIZATION,
target=70,
)

expected_dedicated_resources = gca_machine_resources.DedicatedResources(
Expand Down Expand Up @@ -1136,8 +1139,8 @@ def test_deploy_with_autoscaling_target_accelerator_duty_cycle(self, deploy_mode
)

expected_autoscaling_metric_spec = gca_machine_resources.AutoscalingMetricSpec(
metric_name="aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle",
target=70
metric_name=_TEST_METRIC_NAME_GPU_UTILIZATION,
target=70,
)

expected_dedicated_resources = gca_machine_resources.DedicatedResources(
Expand Down

0 comments on commit e14d1ae

Please sign in to comment.