Skip to content

Change default time to None in IterState#641

Open
GermanHeim wants to merge 2 commits intoargmin-rs:mainfrom
GermanHeim:fix-timer
Open

Change default time to None in IterState#641
GermanHeim wants to merge 2 commits intoargmin-rs:mainfrom
GermanHeim:fix-timer

Conversation

@GermanHeim
Copy link
Contributor

📝 Description

Updated the IterState struct to initialize the time field as None instead of Some(Duration::ZERO). This should fix the timer showing as 0 ns, which was introduced in commit 6492020.

🔨 Changes Made

  • Updated the IterState struct to initialize the time field as None instead of Some(Duration::ZERO).
  • Modified tests to take into account this implementation

🔗 Related Issues

Closes #640

Updated the IterState struct to initialize the time field as None instead of Some(Duration::ZERO). Adjusted related documentation and assertions to fix tests.
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.74%. Comparing base (b300285) to head (000c859).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #641      +/-   ##
==========================================
+ Coverage   91.72%   91.74%   +0.01%     
==========================================
  Files         177      177              
  Lines       20840    20840              
==========================================
+ Hits        19116    19119       +3     
+ Misses       1724     1721       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan-k
Copy link
Member

Lovely, thanks!
Have you tested how this affects the observers?

@GermanHeim
Copy link
Contributor Author

From what I can see, the only observer that actually uses time is the observer spectator (in observe_iter and handle_connection).

Currently, it works because it uses .unwrap_or(std::time::Duration::from_secs(0)),, but this approach isn’t ideal.

One option would be to change the time field in Samples from Duration to Option<Duration> and adjust the code accordingly. Does that sound reasonable to you?

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.

time is always 0ns

3 participants