Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded metrictest types #2864

Merged
merged 5 commits into from Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -42,6 +42,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated.
Use the equivalent `MergeIterator.Attribute` method instead. (#2790)

### Removed

- Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864)
- Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864)

## [0.29.0] - 2022-04-11

### Added
Expand Down
42 changes: 0 additions & 42 deletions sdk/metric/metrictest/alignment_test.go

This file was deleted.

17 changes: 17 additions & 0 deletions sdk/metric/metrictest/exporter.go
Expand Up @@ -20,12 +20,14 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/instrument"
"go.opentelemetry.io/otel/sdk/instrumentation"
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/metric/export"
"go.opentelemetry.io/otel/sdk/metric/export/aggregation"
"go.opentelemetry.io/otel/sdk/metric/number"
processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
"go.opentelemetry.io/otel/sdk/metric/sdkapi"
selector "go.opentelemetry.io/otel/sdk/metric/selector/simple"
)

Expand Down Expand Up @@ -62,6 +64,14 @@ func NewTestMeterProvider(opts ...Option) (metric.MeterProvider, *Exporter) {
return c, exp
}

// Library is the same as "sdk/instrumentation".Library but there is
// a package cycle to use it so it is redeclared here.
type Library struct {
InstrumentationName string
InstrumentationVersion string
SchemaURL string
}

// ExportRecord represents one collected datapoint from the Exporter.
type ExportRecord struct {
InstrumentName string
Expand Down Expand Up @@ -178,3 +188,10 @@ func subSet(attributesA, attributesB []attribute.KeyValue) bool {
}
return true
}

// NewDescriptor is a test helper for constructing test metric
// descriptors using standard options.
func NewDescriptor(name string, ikind sdkapi.InstrumentKind, nkind number.Kind, opts ...instrument.Option) sdkapi.Descriptor {
cfg := instrument.NewConfig(opts...)
return sdkapi.NewDescriptor(name, ikind, nkind, cfg.Description(), cfg.Unit())
}
56 changes: 0 additions & 56 deletions sdk/metric/metrictest/meter.go

This file was deleted.