61 lines
2.1 KiB
Go
61 lines
2.1 KiB
Go
// Code generated by mdatagen. DO NOT EDIT.
|
|
|
|
package metadatatest
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.opentelemetry.io/otel/sdk/metric/metricdata"
|
|
"go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest"
|
|
|
|
"go.opentelemetry.io/collector/component/componenttest"
|
|
)
|
|
|
|
func AssertEqualProcessorIncomingItems(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.DataPoint[int64], opts ...metricdatatest.Option) {
|
|
want := metricdata.Metrics{
|
|
Name: "otelcol_processor_incoming_items",
|
|
Description: "Number of items passed to the processor. [alpha]",
|
|
Unit: "{items}",
|
|
Data: metricdata.Sum[int64]{
|
|
Temporality: metricdata.CumulativeTemporality,
|
|
IsMonotonic: true,
|
|
DataPoints: dps,
|
|
},
|
|
}
|
|
got, err := tt.GetMetric("otelcol_processor_incoming_items")
|
|
require.NoError(t, err)
|
|
metricdatatest.AssertEqual(t, want, got, opts...)
|
|
}
|
|
|
|
func AssertEqualProcessorInternalDuration(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.HistogramDataPoint[float64], opts ...metricdatatest.Option) {
|
|
want := metricdata.Metrics{
|
|
Name: "otelcol_processor_internal_duration",
|
|
Description: "Duration of time taken to process a batch of telemetry data through the processor. [alpha]",
|
|
Unit: "s",
|
|
Data: metricdata.Histogram[float64]{
|
|
Temporality: metricdata.CumulativeTemporality,
|
|
DataPoints: dps,
|
|
},
|
|
}
|
|
got, err := tt.GetMetric("otelcol_processor_internal_duration")
|
|
require.NoError(t, err)
|
|
metricdatatest.AssertEqual(t, want, got, opts...)
|
|
}
|
|
|
|
func AssertEqualProcessorOutgoingItems(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.DataPoint[int64], opts ...metricdatatest.Option) {
|
|
want := metricdata.Metrics{
|
|
Name: "otelcol_processor_outgoing_items",
|
|
Description: "Number of items emitted from the processor. [alpha]",
|
|
Unit: "{items}",
|
|
Data: metricdata.Sum[int64]{
|
|
Temporality: metricdata.CumulativeTemporality,
|
|
IsMonotonic: true,
|
|
DataPoints: dps,
|
|
},
|
|
}
|
|
got, err := tt.GetMetric("otelcol_processor_outgoing_items")
|
|
require.NoError(t, err)
|
|
metricdatatest.AssertEqual(t, want, got, opts...)
|
|
}
|