Skip to content

Introduce DogStatsD payload generation#432

Merged
blt merged 5 commits into
mainfrom
dogstatsd_payload
Jan 10, 2023
Merged

Introduce DogStatsD payload generation#432
blt merged 5 commits into
mainfrom
dogstatsd_payload

Conversation

@blt

@blt blt commented Jan 7, 2023

Copy link
Copy Markdown
Collaborator

This commit introduces DogStatsD payload generation into lading. We support all the variants described here.

Signed-off-by: Brian L. Troutwine brian.troutwine@datadoghq.com

blt added 3 commits January 6, 2023 16:21
This commit introduces DogStatsD payload generation into lading. It's not quite
done yet but the basic arbitrary definitions are in place.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt marked this pull request as ready for review January 10, 2023 00:30
@blt blt requested a review from a team January 10, 2023 00:31
Comment thread src/payload/dogstatsd/common.rs Outdated
impl<'a> arbitrary::Arbitrary<'a> for MetricTagStr {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let choice: u8 = u.arbitrary()?;
let size = SIZES[(choice as usize) % SIZES.len()];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor concern that this would give unevenly distributed choices if SIZES changes length in the future. How about u.int_in_range(0..SIZES.len())?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Much better.

blt added 2 commits January 10, 2023 11:19
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt merged commit b1105c3 into main Jan 10, 2023
@blt blt deleted the dogstatsd_payload branch January 10, 2023 22:47
@blt blt restored the dogstatsd_payload branch April 11, 2023 00:38
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