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

Token bucket and dice + test runner fixes #278

Merged
merged 9 commits into from
Mar 8, 2024
Merged

Conversation

raphael-theriault-swi
Copy link
Member

This adds token bucket and dice implementations for sampling, and updates the test runner as its coverage reports were broken. Additional info in comments.

@raphael-theriault-swi raphael-theriault-swi requested a review from a team as a code owner March 6, 2024 18:48
Comment on lines +22 to +24
const { devDependencies } = JSON.parse(
await readFile("package.json", { encoding: "utf-8" }),
) as { devDependencies: Record<string, string> }
Copy link
Member Author

Choose a reason for hiding this comment

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

Importing from package.json caused some issues with ESM on recent Node versions in tests, this works the same way.

Copy link

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

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

Added a few comments.

The PR looks good to me.

packages/sampling/src/token-bucket.ts Show resolved Hide resolved
packages/sampling/src/token-bucket.ts Show resolved Hide resolved
packages/sampling/test/token-bucket.test.ts Outdated Show resolved Hide resolved
packages/solarwinds-apm/src/index.cjs.ts Show resolved Hide resolved
Copy link

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

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

LGTM.
Ship it!

@raphael-theriault-swi raphael-theriault-swi merged commit 1ffd799 into main Mar 8, 2024
38 checks passed
@raphael-theriault-swi raphael-theriault-swi deleted the NH-74055 branch March 8, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants