Skip to content

Conversation

@misteriaud
Copy link
Member

What does this PR do?

Add configurable sampling frequency to CaptureManager via tick_duration_ms parameter. Previously hardcoded to 1000ms (1Hz), now supports arbitrary intervals (e.g., 100ms for 10Hz, 10ms for 100Hz).

Changes:

  • Add CaptureManagerBuilder for ergonomic configuration
  • Add SignalWatchers struct to group required signal watchers
  • Add tick_duration_ms parameter to all constructors
  • Export DEFAULT_TICK_DURATION_MS constant (1000ms)
  • Standardize tick_duration_ms type to u64 everywhere

Motivation

Being able to capture signal at higher frequency than 1Hz.

Additional Notes

Breaking changes:

  • Constructor signatures changed to use SignalWatchers
  • new_with_format, new_jsonl, new_parquet, new_multi all have new signatures

misteriaud and others added 3 commits January 23, 2026 15:05
Add configurable sampling frequency to CaptureManager via tick_duration_ms
parameter. Previously hardcoded to 1000ms (1Hz), now supports arbitrary
intervals (e.g., 100ms for 10Hz, 10ms for 100Hz).

Changes:
- Add CaptureManagerBuilder for ergonomic configuration
- Add SignalWatchers struct to group required signal watchers
- Add tick_duration_ms parameter to all constructors
- Export DEFAULT_TICK_DURATION_MS constant (1000ms)
- Standardize tick_duration_ms type to u64 everywhere

Breaking changes:
- Constructor signatures changed to use SignalWatchers
- new_with_format, new_jsonl, new_parquet, new_multi all have new signatures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update the main lading binary to use SignalWatchers struct and the new
constructor signature with tick_duration_ms parameter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update the fuzz_capture_harness binary to use SignalWatchers struct
and the new constructor signature with tick_duration_ms parameter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Collaborator

@blt blt left a comment

Choose a reason for hiding this comment

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

Cool, some thoughts on how we thread the needle here but I like where this is headed.

Comment on lines +30 to +33
/// Default duration of a single `Accumulator` tick in milliseconds.
/// This constant is kept for backwards compatibility in tests.
#[cfg(test)]
pub(crate) const DEFAULT_TICK_DURATION_MS: u128 = 1_000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The tests need to vary their tick rate to be valid, else we'll only assert that the default tick is square to what we want. We can drop this constant and add a variable tick parameter to the tests.

Comment on lines +34 to +36
/// Default duration of a single `Accumulator` tick in milliseconds.
/// Can be overridden via [`CaptureManagerBuilder::tick_duration_ms`].
pub const DEFAULT_TICK_DURATION_MS: u64 = 1_000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we're moving this to a configurable item I'd prefer to see us drop these constants and rely solely on the config -> struct field path. That makes converting the tests to have variable tick time more tractable as well.

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.

3 participants