Skip to content

Commit

Permalink
Switches context range from u16 with a max limit of 65k to a u32 with…
Browse files Browse the repository at this point in the history
… a limit we will not hit (#697)
  • Loading branch information
scottopell authored Sep 11, 2023
1 parent 9d604db commit b4781e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lading_payload/src/dogstatsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ mod event;
mod metric;
mod service_check;

fn contexts_minimum() -> u16 {
fn contexts_minimum() -> u32 {
5000
}

fn contexts_maximum() -> u16 {
fn contexts_maximum() -> u32 {
10_000
}

Expand Down Expand Up @@ -124,12 +124,12 @@ pub struct Config {
/// Minimum number of unique metric contexts to generate
/// A context is a set of unique metric name + tags
#[serde(default = "contexts_minimum")]
pub contexts_minimum: u16,
pub contexts_minimum: u32,

/// Maximum number of unique metric contexts to generate
/// A context is a set of unique metric name + tags
#[serde(default = "contexts_maximum")]
pub contexts_maximum: u16,
pub contexts_maximum: u32,

/// Minimum length for a dogstatsd message name
#[serde(default = "name_length_minimum")]
Expand Down Expand Up @@ -263,7 +263,7 @@ struct MemberGenerator {
impl MemberGenerator {
#[allow(clippy::too_many_arguments)]
fn new<R>(
context_range: Range<u16>,
context_range: Range<u32>,
name_length_range: Range<u16>,
tag_key_length_range: Range<u16>,
tag_value_length_range: Range<u16>,
Expand Down Expand Up @@ -445,7 +445,7 @@ impl DogStatsD {
/// Create a new instance of `DogStatsD`.
#[allow(clippy::too_many_arguments)]
pub fn new<R>(
context_range: Range<u16>,
context_range: Range<u32>,
name_length_range: Range<u16>,
tag_key_length_range: Range<u16>,
tag_value_length_range: Range<u16>,
Expand Down

0 comments on commit b4781e4

Please sign in to comment.