-
Notifications
You must be signed in to change notification settings - Fork 13
feat(capture): make tick duration configurable #1727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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>
blt
left a comment
There was a problem hiding this 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.
| /// 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; |
There was a problem hiding this comment.
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.
| /// 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; |
There was a problem hiding this comment.
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.
What does this PR do?
Add configurable sampling frequency to
CaptureManagerviatick_duration_msparameter. Previously hardcoded to 1000ms (1Hz), now supports arbitrary intervals (e.g., 100ms for 10Hz, 10ms for 100Hz).Changes:
CaptureManagerBuilderfor ergonomic configurationSignalWatchersstruct to group required signal watcherstick_duration_msparameter to all constructorsDEFAULT_TICK_DURATION_MSconstant (1000ms)tick_duration_mstype tou64everywhereMotivation
Being able to capture signal at higher frequency than 1Hz.
Additional Notes
Breaking changes: