Skip to content

Commit

Permalink
pretty_print() should return a string
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Feb 1, 2024
1 parent 58c9a46 commit c18d72f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/gamma/csm_observability_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ def from_response(
points=list(response.points),
)

def pretty_print(self):
def pretty_print(self) -> str:
metric = dataclasses.asdict(self)
# too much noise to print all data points from a time series
metric.pop("points")
logger.info(yaml.dump(metric, sort_keys=True))
return yaml.dump(metric, sort_keys=True)


class CsmObservabilityTest(xds_gamma_testcase.GammaXdsKubernetesTestCase):
Expand Down Expand Up @@ -218,7 +219,7 @@ def query_metrics(
metric_time_series = MetricTimeSeries.from_response(
metric, time_series[0]
)
metric_time_series.pretty_print()
logger.info(metric_time_series.pretty_print())
results[metric] = metric_time_series
return results

Expand Down

0 comments on commit c18d72f

Please sign in to comment.