Skip to content

Commit

Permalink
mix format
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed Mar 16, 2024
1 parent 19c0b2d commit e42deea
Showing 1 changed file with 53 additions and 8 deletions.
61 changes: 53 additions & 8 deletions test/otel_metric_tests.exs
Expand Up @@ -17,7 +17,9 @@ defmodule OtelMetricTests do
@fields Record.extract(:sum, from_lib: "opentelemetry_experimental/include/otel_metrics.hrl")
Record.defrecordp(:sum, @fields)

@fields Record.extract(:histogram, from_lib: "opentelemetry_experimental/include/otel_metrics.hrl")
@fields Record.extract(:histogram,
from_lib: "opentelemetry_experimental/include/otel_metrics.hrl"
)
Record.defrecordp(:histogram, @fields)

setup do
Expand Down Expand Up @@ -111,9 +113,31 @@ defmodule OtelMetricTests do
assert_receive {:metric,
metric(
name: :histogram_a,
data: histogram(aggregation_temporality: :temporality_cumulative,
datapoints: [{:histogram_datapoint, %{}, _, _, 1, 1, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0], [], 0, 1, 1}])
data:
histogram(
aggregation_temporality: :temporality_cumulative,
datapoints: [
{:histogram_datapoint, %{}, _, _, 1, 1,
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[
0.0,
5.0,
10.0,
25.0,
50.0,
75.0,
100.0,
250.0,
500.0,
750.0,
1000.0,
2500.0,
5000.0,
7500.0,
10000.0
], [], 0, 1, 1}
]
)
)}

Histogram.record(:histogram_a, 10)
Expand All @@ -123,10 +147,31 @@ defmodule OtelMetricTests do
assert_receive {:metric,
metric(
name: :histogram_a,
data: histogram(aggregation_temporality: :temporality_cumulative,
datapoints: [{:histogram_datapoint, %{}, _, _, 2, 11, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0], [], 0, 1, 10}])
data:
histogram(
aggregation_temporality: :temporality_cumulative,
datapoints: [
{:histogram_datapoint, %{}, _, _, 2, 11,
[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[
0.0,
5.0,
10.0,
25.0,
50.0,
75.0,
100.0,
250.0,
500.0,
750.0,
1000.0,
2500.0,
5000.0,
7500.0,
10000.0
], [], 0, 1, 10}
]
)
)}
end

end

0 comments on commit e42deea

Please sign in to comment.