Drop the gauge instrument (#537)

* drop gauge instrument

* Restore the benchmark and stress test for lastvalue aggregator, but remove monotonic last-value support

* Rename gauge->lastvalue and remove remaining uses of the word 'gauge'

Co-authored-by: Krzesimir Nowak <krzesimir@kinvolk.io>
This commit is contained in:
Joshua MacDonald
2020-03-10 16:00:37 -07:00
committed by GitHub
co-authored by Krzesimir Nowak
parent fe0099fb3d
commit 9674c81cb7
33 changed files with 333 additions and 1048 deletions
@@ -26,14 +26,14 @@ import (
export "go.opentelemetry.io/otel/sdk/export/metric"
"go.opentelemetry.io/otel/sdk/export/metric/aggregator"
"go.opentelemetry.io/otel/sdk/metric/aggregator/counter"
"go.opentelemetry.io/otel/sdk/metric/aggregator/gauge"
"go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue"
)
func TestInconsistentMergeErr(t *testing.T) {
err := aggregator.NewInconsistentMergeError(counter.New(), gauge.New())
err := aggregator.NewInconsistentMergeError(counter.New(), lastvalue.New())
require.Equal(
t,
"cannot merge *counter.Aggregator with *gauge.Aggregator: inconsistent aggregator types",
"cannot merge *counter.Aggregator with *lastvalue.Aggregator: inconsistent aggregator types",
err.Error(),
)
require.True(t, errors.Is(err, aggregator.ErrInconsistentType))
@@ -67,7 +67,7 @@ func testRangeNegative(t *testing.T, alt bool, desc *export.Descriptor) {
require.Nil(t, posErr)
if desc.MetricKind() == export.GaugeKind {
if desc.MetricKind() == export.ObserverKind {
require.Nil(t, negErr)
} else {
require.Equal(t, negErr == nil, alt)
@@ -79,8 +79,8 @@ func TestRangeTest(t *testing.T) {
t.Run(nkind.String(), func(t *testing.T) {
for _, mkind := range []export.Kind{
export.CounterKind,
export.GaugeKind,
export.MeasureKind,
export.ObserverKind,
} {
t.Run(mkind.String(), func(t *testing.T) {
for _, alt := range []bool{true, false} {