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

Yicong-Huang merged 8 commits into
apache:mainfrom
Ma77Ball:fix/get_statistics

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

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

@Ma77Ball
Ma77Ball requested a review from Yicong-Huang May 4, 2026 06:54

@Yicong-Huang Yicong-Huang left a comment

Copy link
Copy Markdown
Contributor

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

Ma77Ball commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@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
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 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: apache#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?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'. 
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
Co-Authored with Claude Opus 4.6 in Compliance with ASF

---------

Signed-off-by: Matthew B. <[email protected]>
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