Skip to content

fix: Adding Floor to idle_time#4900

Merged
Yicong-Huang merged 8 commits into
apache:mainfrom
Ma77Ball:fix/get_statistics
May 5, 2026
Merged

fix: Adding Floor to idle_time#4900
Yicong-Huang merged 8 commits into
apache:mainfrom
Ma77Ball:fix/get_statistics

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 4, 2026

What changes were proposed in this PR?

  • idle_time was computed as total_execution_time - data_processing_time - control_processing_time, with no lower bound — timing races could make it negative and propagate bad values to the dashboard
  • Added drift detection warning in update_total_execution_time when the new total is less than the accumulated processing time
  • Added monotonicity check in update_total_execution_time to catch non-increasing timestamps
  • get_statistics() clamps idle_time to 0 via max(0, ...)

Any related issues, documentation, or discussions?

closes: #4892

How was this PR tested?

  • Updated TestStatisticsManagerExecutionTime to assert idle_time == 0 for the overshoot case instead of -30
  • Removed the xfail marker that was tracking the unfixed bug

Was this PR authored or co-authored using generative AI tooling?

Co-Authored with Claude Opus 4.6 in Compliance with ASF

Signed-off-by: Matthew B. <mgball@uci.edu>
Comment thread amber/src/main/python/core/architecture/managers/statistics_manager.py Outdated
@Ma77Ball Ma77Ball requested a review from Yicong-Huang May 4, 2026 06:54
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix!

@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 4, 2026 20:28
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

Ma77Ball commented May 5, 2026

@Yicong-Huang, can you approve the two missing CI checks?

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang, can you approve the two missing CI checks?

Let me see if I can make a command similar to /take to do this. it might have some security concerns. I will research about it.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.16%. Comparing base (c533305) to head (0f258c7).

Files with missing lines Patch % Lines
...n/core/architecture/managers/statistics_manager.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #4900   +/-   ##
=========================================
  Coverage     42.15%   42.16%           
  Complexity     2179     2179           
=========================================
  Files           980      980           
  Lines         36298    36305    +7     
  Branches       3783     3783           
=========================================
+ Hits          15303    15308    +5     
- Misses        20066    20068    +2     
  Partials        929      929           
Flag Coverage Δ
python 87.38% <75.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang Yicong-Huang merged commit 056e39d into apache:main May 5, 2026
16 checks passed
@Ma77Ball Ma77Ball deleted the fix/get_statistics branch May 5, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StatisticsManager.get_statistics returns negative idle_time when data+control time exceeds total

3 participants