Skip to content

Commit

Permalink
Removing deprecated Type functions (#4933)
Browse files Browse the repository at this point in the history
* Removing deprecated Type functions

These have been replaced with ValueType.

* add changelog

* fix tests

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
Alex Boten and bogdandrutu authored Mar 2, 2022
1 parent 0c99b50 commit 4bde11b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### 🛑 Breaking changes 🛑

- Remove `Type` funcs in pdata (#4933)

## v0.46.0 Beta

### 🛑 Breaking changes 🛑
Expand Down
10 changes: 0 additions & 10 deletions model/pdata/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,3 @@ func (mdt MetricValueType) String() string {
}
return ""
}

// Deprecated: [v0.45.0] Use ValueType instead.
func (ms NumberDataPoint) Type() MetricValueType {
return ms.ValueType()
}

// Deprecated: [v0.45.0] Use ValueType instead.
func (ms Exemplar) Type() MetricValueType {
return ms.ValueType()
}
12 changes: 0 additions & 12 deletions model/pdata/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,18 +670,6 @@ func TestMetricsDataPointFlags(t *testing.T) {
assert.Equal(t, "FLAG_NO_RECORDED_VALUE", gauge.DataPoints().At(0).Flags().String())
}

// TestNumberDataPointType tests deprecated NumberDataPoint.Type
func TestNumberDataPointType(t *testing.T) {
tv := NewNumberDataPoint()
assert.Equal(t, tv.ValueType(), tv.Type())
}

// TestExemplarType tests deprecated Exemplar.Type
func TestExemplarType(t *testing.T) {
tv := NewExemplar()
assert.Equal(t, tv.ValueType(), tv.Type())
}

func BenchmarkMetricsClone(b *testing.B) {
metrics := NewMetrics()
fillTestResourceMetricsSlice(metrics.ResourceMetrics())
Expand Down

0 comments on commit 4bde11b

Please sign in to comment.