Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Jan 26, 2024
1 parent 00d7b03 commit e9ea996
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions tests/gamma/csm_observability_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
_METRIC_SERVER_CALL_RCVD,
_METRIC_SERVER_CALL_SENT,
]
_CLIENT_SENT_METRICS = [
_METRIC_CLIENT_ATTEMPT_SENT,
_METRIC_SERVER_CALL_RCVD,
]
_SERVER_SENT_METRICS = [
_METRIC_CLIENT_ATTEMPT_RCVD,
_METRIC_SERVER_CALL_SENT,
]
_COUNTER_CLIENT_METRICS = [
_METRIC_CLIENT_ATTEMPT_STARTED,
]
Expand Down Expand Up @@ -250,9 +242,6 @@ def test_csm_observability(self):
"grpc_method",
"grpc_status",
"grpc_target",
"otel_scope_name",
"otel_scope_version",
"pod",
]:
self.assertIn(label_key, metric_labels)

Expand All @@ -270,9 +259,6 @@ def test_csm_observability(self):
"csm_workload_canonical_service",
"grpc_method",
"grpc_status",
"otel_scope_name",
"otel_scope_version",
"pod",
]:
self.assertIn(label_key, metric_labels)

Expand All @@ -281,19 +267,13 @@ def test_csm_observability(self):
for label_key in [
"grpc_method",
"grpc_target",
"otel_scope_name",
"otel_scope_version",
"pod",
]:
self.assertIn(label_key, metric_labels)

for metric in _COUNTER_SERVER_METRICS:
metric_labels = all_results[metric][0].metric.labels
for label_key in [
"grpc_method",
"otel_scope_name",
"otel_scope_version",
"pod",
]:
self.assertIn(label_key, metric_labels)

Expand Down Expand Up @@ -470,14 +450,20 @@ def test_csm_observability(self):
# should have at least 1 data point whose mean should converge to be
# close to the number of bytes being sent by the RPCs.
with self.subTest("10_check_bytes_sent_vs_data_points"):
for metric in _CLIENT_SENT_METRICS:
for metric in [
_METRIC_CLIENT_ATTEMPT_SENT,
_METRIC_SERVER_CALL_RCVD,
]:
self.assertTrue(
self._at_least_one_point_within_range(
all_results[metric][0].points, _REQUEST_PAYLOAD_SIZE
)
)

for metric in _SERVER_SENT_METRICS:
for metric in [
_METRIC_CLIENT_ATTEMPT_RCVD,
_METRIC_SERVER_CALL_SENT,
]:
self.assertTrue(
self._at_least_one_point_within_range(
all_results[metric][0].points, _RESPONSE_PAYLOAD_SIZE
Expand Down

0 comments on commit e9ea996

Please sign in to comment.