You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dfir_rs): provide DfirMetricsIntervals iterator to prevent race conditions when writing metrics (#2401)
Less confusing as `reset()` is no longer used, a la feedback
#2241 (comment)
Not actually a breaking change as the metrics API has not been published
yet
---
This PR refactors the DFIR metrics API to replace the mutable `reset()` pattern with an immutable iterator-based approach, addressing race condition concerns when writing metrics. The key change introduces `DfirMetricsIntervals`, an infinite iterator that provides snapshots of metrics for each interval.
- Replaces the `reset()` method with an infinite iterator pattern via `DfirMetricsIntervals`
- Restructures `DfirMetrics` to be a simpler snapshot struct instead of managing current/previous state
- Adds new `metrics_intervals()` method to `Dfir` for obtaining the iterator
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0 commit comments