Skip to content

Commit

Permalink
*: test histograms, exponential
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0rez committed Nov 1, 2024
1 parent c379bbd commit b5430c6
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
96 changes: 96 additions & 0 deletions processor/deltatocumulativeprocessor/testdata/exponential/1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
-- in --
resourceMetrics:
- schemaUrl: https://test.com/resource
scopeMetrics:
- schemaUrl: https://test.com/scope
scope:
name: Test
version: 1.2.3
metrics:
- name: expo.simple
exponential_histogram:
aggregationTemporality: 1
dataPoints:
- timeUnixNano: 10
scale: 4
zeroCount: 5
positive:
offset: 2
bucketCounts: [4, 7, 9, 6, 25]
negative:
offset: 6
bucketCounts: [2, 13, 7, 12, 4]
- timeUnixNano: 20
scale: 4
zeroCount: 2
positive:
offset: 2
bucketCounts: [1, 2, 1, 2, 1]
negative:
offset: 6
bucketCounts: [1, 2, 1, 2, 1]
- name: expo.downscale
exponential_histogram:
aggregationTemporality: 1
dataPoints:
- timeUnixNano: 10
scale: 2
zeroCount: 1
positive:
bucketCounts: [1,2,3,4,5]
- timeUnixNano: 20
scale: 1
zeroCount: 0
positive:
bucketCounts: [0,0,0,0,0]

-- out --
resourceMetrics:
- schemaUrl: https://test.com/resource
scopeMetrics:
- schemaUrl: https://test.com/scope
scope:
name: Test
version: 1.2.3
metrics:
- name: expo.simple
exponential_histogram:
aggregationTemporality: 2
dataPoints:
- timeUnixNano: 10
scale: 4
zeroCount: 5
positive:
offset: 2
bucketCounts: [4, 7, 9, 6, 25]
negative:
offset: 6
bucketCounts: [2, 13, 7, 12, 4]
- timeUnixNano: 20
scale: 4
zeroCount: 7
positive:
offset: 2
bucketCounts: [5, 9, 10, 8, 26]
negative:
offset: 6
bucketCounts: [3, 15, 8, 14, 5]

- name: expo.downscale
exponential_histogram:
aggregationTemporality: 2
dataPoints:
- timeUnixNano: 10
scale: 2
zeroCount: 1
positive:
bucketCounts: [1,2,3,4,5]
- timeUnixNano: 20
scale: 1
zeroCount: 1
positive:
bucketCounts: [3,7,5,0,0]

-- telemetry --
updown otelcol_deltatocumulative.streams.tracked:
- int: 2
53 changes: 53 additions & 0 deletions processor/deltatocumulativeprocessor/testdata/histograms/1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-- in --
resourceMetrics:
- schemaUrl: https://test.com/resource
scopeMetrics:
- schemaUrl: https://test.com/scope
scope:
name: test
version: 1.2.3
metrics:
- name: some.histogram
histogram:
aggregationTemporality: 1
dataPoints:
- timeUnixNano: 10
explicitBounds: [0.01, 0.1, 1, 10, 100]
bucketCounts: [1, 2, 3, 4, 5]
- timeUnixNano: 20
explicitBounds: [0.01, 0.1, 1, 10, 100]
bucketCounts: [1, 0, 1, 0, 1]

# bounds change
- timeUnixNano: 30
explicitBounds: [ 0.1, 1, 10, 100]
bucketCounts: [ 1, 2, 3, 4]

-- out --
resourceMetrics:
- schemaUrl: https://test.com/resource
scopeMetrics:
- schemaUrl: https://test.com/scope
scope:
name: test
version: 1.2.3
metrics:
- name: some.histogram
histogram:
aggregationTemporality: 2
dataPoints:
- timeUnixNano: 10
explicitBounds: [0.01, 0.1, 1, 10, 100]
bucketCounts: [1, 2, 3, 4, 5]
- timeUnixNano: 20
explicitBounds: [0.01, 0.1, 1, 10, 100]
bucketCounts: [2, 2, 4, 4, 6]

# bounds change: reset
- timeUnixNano: 30
explicitBounds: [ 0.1, 1, 10, 100]
bucketCounts: [ 1, 2, 3, 4]

-- telemetry --
updown otelcol_deltatocumulative.streams.tracked:
- int: 1

0 comments on commit b5430c6

Please sign in to comment.