Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statsdtest: Move mock statsd client for testing into its own package #2564

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Feb 15, 2024

What does this PR do?

Moves the mock statsd client for testing out of the tracer package and into its own internal statsdtest package.

Motivation

The infrastructure for testing statsd metric submission / statsd client successes was internal and lived within the tracer package, in the ddtrace/tracer/metrics_test.go file. In developing valuable tests for the new StatsCarrier type (PR), which supports the "sharing" of statsd metrics between contrib packages and tracer package, we realized we needed access to this mock statsd client in non-tracer packages. Thus, the mock statsd client was made accessible to all packages within the repo by moving into its own internal package.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@mtoffl01 mtoffl01 requested review from a team as code owners February 15, 2024 15:25
internal/statsdtest/statsdtest.go Outdated Show resolved Hide resolved
internal/statsdtest/statsdtest.go Outdated Show resolved Hide resolved
internal/statsdtest/statsdtest.go Outdated Show resolved Hide resolved
internal/statsdtest/statsdtest.go Outdated Show resolved Hide resolved
internal/statsdtest/statsdtest.go Outdated Show resolved Hide resolved
@darccio
Copy link
Contributor

darccio commented Feb 15, 2024

@mtoffl01 PR looks good. Please fix the linter warnings and we'll approve it.

@pr-commenter
Copy link

pr-commenter bot commented Feb 15, 2024

Benchmarks

Benchmark execution time: 2024-02-15 18:30:10

Comparing candidate commit fd38971 in PR branch mtoff/statsdtests with baseline commit dbe790f in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 40 metrics, 1 unstable metrics.

@darccio darccio enabled auto-merge (squash) February 16, 2024 15:30
@darccio darccio merged commit 655e11c into main Feb 16, 2024
156 of 157 checks passed
@darccio darccio deleted the mtoff/statsdtests branch February 16, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants