Skip to content

Commit

Permalink
fix: review comments about package naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pgimalac committed May 22, 2024
1 parent 947e550 commit 793d284
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion comp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Package pidmap implements a component for tracking pid and containerID relations

### [comp/dogstatsd/replay](https://pkg.go.dev/github.com/DataDog/datadog-agent/comp/dogstatsd/replay)

Package server implements a component to run the dogstatsd capture/replay
Package replay is a component to run the dogstatsd capture/replay

### [comp/dogstatsd/server](https://pkg.go.dev/github.com/DataDog/datadog-agent/comp/dogstatsd/server)

Expand Down
4 changes: 2 additions & 2 deletions comp/api/api/apiimpl/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/tagger"
"github.com/DataDog/datadog-agent/comp/core/tagger/taggerimpl"
"github.com/DataDog/datadog-agent/comp/core/workloadmeta"
replaydef "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/def"
replay "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/def"
replaymock "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/fx-mock"
dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server"
dogstatsddebug "github.com/DataDog/datadog-agent/comp/dogstatsd/serverDebug"
Expand Down Expand Up @@ -68,7 +68,7 @@ type testdeps struct {
// TODO: remove these in the next PR once StartServer component arguments
// are part of the api component dependency struct
DogstatsdServer dogstatsdServer.Component
Capture replaydef.Component
Capture replay.Component
ServerDebug dogstatsddebug.Component
HostMetadata host.Component
InvAgent inventoryagent.Component
Expand Down
6 changes: 2 additions & 4 deletions comp/dogstatsd/replay/def/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

// Package server implements a component to run the dogstatsd capture/replay
//
//nolint:revive // TODO(AML) Fix revive linter
package def
// Package replay is a component to run the dogstatsd capture/replay
package replay

import (
"time"
Expand Down
8 changes: 4 additions & 4 deletions comp/dogstatsd/replay/impl/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
configComponent "github.com/DataDog/datadog-agent/comp/core/config"
compdef "github.com/DataDog/datadog-agent/comp/def"
"github.com/DataDog/datadog-agent/comp/dogstatsd/packets"
replaydef "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/def"
replay "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/def"
"github.com/DataDog/datadog-agent/pkg/config"
)

Expand All @@ -40,7 +40,7 @@ type trafficCapture struct {
// TODO: (components) - remove once serverless is an FX app
//
//nolint:revive // TODO(AML) Fix revive linter
func NewServerlessTrafficCapture() replaydef.Component {
func NewServerlessTrafficCapture() replay.Component {
tc := newTrafficCaptureCompat(config.Datadog)
_ = tc.configure(context.TODO())
return tc
Expand All @@ -49,7 +49,7 @@ func NewServerlessTrafficCapture() replaydef.Component {
// TODO: (components) - merge with newTrafficCaptureCompat once NewServerlessTrafficCapture is removed
//
//nolint:revive // TODO(AML) Fix revive linter
func NewTrafficCapture(deps Requires) replaydef.Component {
func NewTrafficCapture(deps Requires) replay.Component {
tc := newTrafficCaptureCompat(deps.Config)
deps.Lc.Append(compdef.Hook{
OnStart: tc.configure,
Expand Down Expand Up @@ -129,7 +129,7 @@ func (tc *trafficCapture) RegisterOOBPoolManager(p *packets.PoolManager) error {
}

// Enqueue enqueues a capture buffer so it's written to file.
func (tc *trafficCapture) Enqueue(msg *replaydef.CaptureBuffer) bool {
func (tc *trafficCapture) Enqueue(msg *replay.CaptureBuffer) bool {
tc.RLock()
defer tc.RUnlock()
return tc.writer.Enqueue(msg)
Expand Down

0 comments on commit 793d284

Please sign in to comment.