Skip to content

Commit 907796c

Browse files
committed
add buffer_count_max to SourceConfig
Mirror upstream dogstatsd_buffer_count_max (elastic pool ceiling, default 256) into the Saluki-only config path.
1 parent 6e2a37d commit 907796c

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

lib/agent-data-plane-config/src/saluki_only.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pub struct DogStatsDSalukiOnly {
4141
/// Number of receive buffers (`dogstatsd_buffer_count`).
4242
pub buffer_count: Option<usize>,
4343

44+
/// Max receive buffers (`dogstatsd_buffer_count_max`).
45+
pub buffer_count_max: Option<usize>,
46+
4447
/// Max cached metric contexts (`dogstatsd_cached_contexts_limit`).
4548
pub cached_contexts_limit: Option<usize>,
4649

@@ -79,6 +82,9 @@ impl SalukiOnlyConfiguration {
7982
if let Some(v) = self.dogstatsd.buffer_count {
8083
dsd.buffer_count = v;
8184
}
85+
if let Some(v) = self.dogstatsd.buffer_count_max {
86+
dsd.buffer_count_max = v;
87+
}
8288
if let Some(v) = self.dogstatsd.cached_contexts_limit {
8389
dsd.cached_contexts_limit = v;
8490
}

lib/saluki-component-config/src/dogstatsd.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ pub struct SourceConfig {
2626
/// Payloads larger than this are truncated, leading to discarded messages. Defaults to 8192.
2727
pub buffer_size: usize,
2828

29-
/// The number of message buffers to allocate overall.
29+
/// The number of message buffers to allocate up front.
3030
///
3131
/// Defaults to 128.
3232
pub buffer_count: usize,
3333

34+
/// The maximum number of message buffers to allocate overall.
35+
///
36+
/// The pool grows on demand from `buffer_count` up to this limit. A value below `buffer_count`
37+
/// is treated as equal to it. Defaults to 256.
38+
pub buffer_count_max: usize,
39+
3440
/// The UDP port to listen on. If set to `0`, UDP is not used.
3541
///
3642
/// Defaults to 8125.
@@ -170,6 +176,7 @@ impl Default for SourceConfig {
170176
Self {
171177
buffer_size: 8192,
172178
buffer_count: 128,
179+
buffer_count_max: 256,
173180
port: 8125,
174181
socket_receive_buffer_size: 0,
175182
tcp_port: 0,

0 commit comments

Comments
 (0)