Skip to content

Commit

Permalink
Remove unneeded metrictest types (#2864)
Browse files Browse the repository at this point in the history
* Remove unneeded metrictest types

* Add changes to changelog

* Revert removal of NewDescriptor
  • Loading branch information
MrAlias committed Apr 27, 2022
1 parent d342bde commit 776accd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 98 deletions.
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.

0 comments on commit 776accd

Please sign in to comment.