Skip to content

Commit

Permalink
fix: Enable stats collection (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops committed Mar 29, 2024
1 parent 4a2015c commit 6f840d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rust-arroyo/src/backends/kafka/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::collections::HashMap;

use super::InitialOffset;

const STATS_COLLECTION_FREQ_MS: u32 = 1000;

#[derive(Debug, Clone)]
pub struct OffsetResetConfig {
pub auto_offset_reset: InitialOffset,
Expand Down Expand Up @@ -54,6 +56,11 @@ impl KafkaConfig {
max_poll_interval_ms.to_string(),
);

config.config_map.insert(
"statistics.interval.ms".to_string(),
STATS_COLLECTION_FREQ_MS.to_string(),
);

// HACK: If the max poll interval is less than 45 seconds, set the session timeout
// to the same. (its default is 45 seconds and it must be <= to max.poll.interval.ms)
if max_poll_interval_ms < 45_000 {
Expand Down

0 comments on commit 6f840d8

Please sign in to comment.