| 1 |
// Code generated by mdatagen. DO NOT EDIT. |
| 2 |
|
| 3 |
package metadatatest |
| 4 |
|
| 5 |
import ( |
| 6 |
"testing" |
| 7 |
|
| 8 |
"github.com/stretchr/testify/require" |
| 9 |
"go.opentelemetry.io/otel/sdk/metric/metricdata" |
| 10 |
"go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" |
| 11 |
|
| 12 |
"go.opentelemetry.io/collector/component/componenttest" |
| 13 |
) |
| 14 |
|
| 15 |
func AssertEqualProcessorIncomingItems(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.DataPoint[int64], opts ...metricdatatest.Option) { |
| 16 |
want := metricdata.Metrics{ |
| 17 |
Name: "otelcol_processor_incoming_items", |
| 18 |
Description: "Number of items passed to the processor. [Alpha]", |
| 19 |
Unit: "{items}", |
| 20 |
Data: metricdata.Sum[int64]{ |
| 21 |
Temporality: metricdata.CumulativeTemporality, |
| 22 |
IsMonotonic: true, |
| 23 |
DataPoints: dps, |
| 24 |
}, |
| 25 |
} |
| 26 |
got, err := tt.GetMetric("otelcol_processor_incoming_items") |
| 27 |
require.NoError(t, err) |
| 28 |
metricdatatest.AssertEqual(t, want, got, opts...) |
| 29 |
} |
| 30 |
|
| 31 |
func AssertEqualProcessorInternalDuration(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.HistogramDataPoint[float64], opts ...metricdatatest.Option) { |
| 32 |
want := metricdata.Metrics{ |
| 33 |
Name: "otelcol_processor_internal_duration", |
| 34 |
Description: "Duration of time taken to process a batch of telemetry data through the processor. [Alpha]", |
| 35 |
Unit: "s", |
| 36 |
Data: metricdata.Histogram[float64]{ |
| 37 |
Temporality: metricdata.CumulativeTemporality, |
| 38 |
DataPoints: dps, |
| 39 |
}, |
| 40 |
} |
| 41 |
got, err := tt.GetMetric("otelcol_processor_internal_duration") |
| 42 |
require.NoError(t, err) |
| 43 |
metricdatatest.AssertEqual(t, want, got, opts...) |
| 44 |
} |
| 45 |
|
| 46 |
func AssertEqualProcessorOutgoingItems(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.DataPoint[int64], opts ...metricdatatest.Option) { |
| 47 |
want := metricdata.Metrics{ |
| 48 |
Name: "otelcol_processor_outgoing_items", |
| 49 |
Description: "Number of items emitted from the processor. [Alpha]", |
| 50 |
Unit: "{items}", |
| 51 |
Data: metricdata.Sum[int64]{ |
| 52 |
Temporality: metricdata.CumulativeTemporality, |
| 53 |
IsMonotonic: true, |
| 54 |
DataPoints: dps, |
| 55 |
}, |
| 56 |
} |
| 57 |
got, err := tt.GetMetric("otelcol_processor_outgoing_items") |
| 58 |
require.NoError(t, err) |
| 59 |
metricdatatest.AssertEqual(t, want, got, opts...) |
| 60 |
} |