Skip to content

Commit

Permalink
clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
movence committed Mar 1, 2024
1 parent cc3bf6e commit 852fff7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DCGM_FI_DEV_GPU_UTIL{gpu="0",UUID="uuid",device="nvidia0",modelName="NVIDIA A10G
`

const (
dummyInstanceId = "i-0000000000"
dummyInstanceID = "i-0000000000"
dummyClusterName = "cluster-name"
)

Expand All @@ -47,7 +47,7 @@ func (m mockHostInfoProvider) GetClusterName() string {
}

func (m mockHostInfoProvider) GetInstanceID() string {
return dummyInstanceId
return dummyInstanceID
}

type mockDecorator struct {
Expand Down Expand Up @@ -96,7 +96,7 @@ func (m mockConsumer) ConsumeMetrics(_ context.Context, md pmetric.Metrics) erro
assert.True(m.t, found)
assert.Equal(m.t, v, lv.AsString())
}
scrapedMetricCnt += 1
scrapedMetricCnt++
}
assert.Equal(m.t, len(m.expected), scrapedMetricCnt)
*m.called = true
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestNewDcgmScraperEndToEnd(t *testing.T) {
ci.NodeNameKey: "hostname",
ci.AttributeK8sNamespace: "kube-system",
ci.ClusterNameKey: dummyClusterName,
ci.InstanceID: dummyInstanceId,
ci.InstanceID: dummyInstanceID,
ci.AttributeFullPodName: "fullname-hash",
ci.AttributeK8sPodName: "fullname-hash",
ci.AttributeContainerName: "main",
Expand All @@ -163,7 +163,7 @@ func TestNewDcgmScraperEndToEnd(t *testing.T) {
ci.NodeNameKey: "hostname",
ci.AttributeK8sNamespace: "kube-system",
ci.ClusterNameKey: dummyClusterName,
ci.InstanceID: dummyInstanceId,
ci.InstanceID: dummyInstanceID,
ci.AttributeFullPodName: "fullname-hash",
ci.AttributeK8sPodName: "fullname-hash",
ci.AttributeContainerName: "main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/pmetric"
Expand All @@ -31,19 +30,6 @@ func (m *MockK8sDecorator) Shutdown() error {
return nil
}

type mockNextConsumer struct {
}

func (mc *mockNextConsumer) Capabilities() consumer.Capabilities {
return consumer.Capabilities{
MutatesData: true,
}
}

func (mc *mockNextConsumer) ConsumeMetrics(_ context.Context, md pmetric.Metrics) error {
return nil
}

func TestConsumeMetrics(t *testing.T) {
logger, _ := zap.NewDevelopment()
dc := &decorateConsumer{
Expand Down
3 changes: 1 addition & 2 deletions receiver/awscontainerinsightreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import (
"go.uber.org/zap"
"k8s.io/client-go/rest"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/gpu"

ci "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s/k8sclient"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/cadvisor"
ecsinfo "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/ecsInfo"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/gpu"
hostInfo "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/k8sapiserver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/stores"
Expand Down

0 comments on commit 852fff7

Please sign in to comment.