wilmerdooley opened a new pull request, #67664:
URL: https://github.com/apache/airflow/pull/67664

   ### What
   
   The Dashboard "Historical Metrics" percentages are computed in the frontend 
as count / total, where total is the sum of the per-state counts. The 
`/ui/dashboard/historical_metrics_data` endpoint caps each state count at 
`STATE_COUNT_CAP` (1000) for performance, so when any state exceeds the cap the 
summed total is only a lower bound and every per-state percentage is wrong. 
Example from the issue: success has 2500 runs but the API returns 1000, so 
failure (7) shows 7/1007 instead of 7/2507.
   
   ### Fix
   
   This takes option 2 from the issue: hide the percentages for a metric group 
when any of its states is capped, rather than display a wrong number. 
`MetricSection` already hid the percentage for a state that is itself capped; 
this adds a group-level `totalCapped` flag (true when any state is at or above 
the limit) so the percentage is hidden for all states in the group when the 
total is unreliable. The per-state "N+" label and the API cap stay as they are.
   
   I kept the cap and fixed this in the frontend rather than returning real 
counts (option 1), because the cap on this endpoint is a deliberate performance 
bound that has been optimized for large installations (e.g. #62152, #63166); 
returning unbounded counts would reintroduce that cost.
   
   closes: #67336
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to