From 68797807bc968a0832871c303bb63c72266c98fe Mon Sep 17 00:00:00 2001 From: George Hahn Date: Fri, 10 May 2024 15:26:24 -0600 Subject: [PATCH] Dogstatsd: generate values that include the max of inclusive config ranges (#891) * Off by one on the top of ConfRange::Inclusive * changelog --- CHANGELOG.md | 4 ++++ lading_payload/src/dogstatsd.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71efeaf0a..f254dcbf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Fixed +- Range values in the dogstatsd payload will now generate the full inclusive + range. Previously, values were generated up to but not including the `max` + value. ## [0.21.0] ### Changed diff --git a/lading_payload/src/dogstatsd.rs b/lading_payload/src/dogstatsd.rs index 6f5b14694..e051649c8 100644 --- a/lading_payload/src/dogstatsd.rs +++ b/lading_payload/src/dogstatsd.rs @@ -203,7 +203,7 @@ where { match self { ConfRange::Constant(c) => *c, - ConfRange::Inclusive { min, max } => rng.gen_range(*min..*max), + ConfRange::Inclusive { min, max } => rng.gen_range(*min..=*max), } } }