From 1e19c8b0d43f70bd7ba7241924d4f3122f968b0e Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Sat, 16 Nov 2024 16:22:24 +0200 Subject: [PATCH] docs: sort metrics by name --- docs/oteljava/testkit.md | 2 +- docs/sdk/testkit.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/oteljava/testkit.md b/docs/oteljava/testkit.md index dd243e735..13f0b97a6 100644 --- a/docs/oteljava/testkit.md +++ b/docs/oteljava/testkit.md @@ -76,7 +76,7 @@ def test: IO[Unit] = // here you can use an assertion mechanism from your favorite testing framework def assertMetrics(metrics: List[Metric], expected: List[TelemetryMetric]): IO[Unit] = IO { - assert(metrics.map(TelemetryMetric.fromMetric) == expected) + assert(metrics.sortBy(_.name).map(TelemetryMetric.fromMetric) == expected) } // a minimized representation of the MetricData to simplify testing diff --git a/docs/sdk/testkit.md b/docs/sdk/testkit.md index 6af4f21db..c28c9ff49 100644 --- a/docs/sdk/testkit.md +++ b/docs/sdk/testkit.md @@ -76,7 +76,7 @@ def test: IO[Unit] = // here you can use an assertion mechanism from your favorite testing framework def assertMetrics(metrics: List[MetricData], expected: List[TelemetryMetric]): IO[Unit] = IO { - assert(metrics.map(TelemetryMetric.fromMetricData) == expected) + assert(metrics.sortBy(_.name).map(TelemetryMetric.fromMetricData) == expected) } // a minimized representation of the MetricData to simplify testing