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

Added tests for visibility sampling wrapper #5564

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

3vilhamster
Copy link
Contributor

What changed?
I've refactored visibility sampling manager:

  • Moved it to wrappers
  • Separated ratelimiter logic from the manager
  • Added tests

There are no logical changes.

Why?
Improving test coverage

How did you test it?
Unit tests/integration tests.

Potential risks

Release notes

Documentation Changes

common/persistence/wrappers/sampled/visibility_manager.go Outdated Show resolved Hide resolved
ok, _ := rateLimiter.GetToken(0, 1)
if ok {
p.logger.Debug("List API request consumed QPS token", tag.WorkflowDomainName(domain), tag.Name(callerFuncName(2)))
p.logger.Debug("List API request consumed QPS token", tag.WorkflowDomainName(domain), tag.Name(method))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea getting rid of the not-future-safe callerFuncName here

@3vilhamster 3vilhamster enabled auto-merge (squash) December 29, 2023 21:22
@3vilhamster 3vilhamster merged commit efef2e0 into uber:master Dec 29, 2023
16 checks passed
@3vilhamster 3vilhamster deleted the visibility-sampling-wrapper branch December 29, 2023 22:01
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.

2 participants