Skip to content

fix: use float division for success ratio calculation (fixes #1163) - #1228

Open
AruneshDwivedi wants to merge 1 commit into
eraser-dev:mainfrom
AruneshDwivedi:fix/issue-1163-integer-division
Open

fix: use float division for success ratio calculation (fixes #1163)#1228
AruneshDwivedi wants to merge 1 commit into
eraser-dev:mainfrom
AruneshDwivedi:fix/issue-1163-integer-division

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Fixes #1163

The success ratio calculation used integer division:
float64(successAndSkipped/imageJob.Status.Desired)

This means 273/273 = 1 (integer division), but 272/273 = 0 (integer division),
causing the job to incorrectly fail even with 99%+ success.

The fix: cast to float64 before division:
float64(successAndSkipped)/float64(imageJob.Status.Desired)

Also fixes the log output which had the same integer division bug.

…ev#1163)

The success ratio calculation used integer division:
  float64(successAndSkipped/imageJob.Status.Desired)

This means 273/273 = 1 (integer division), but 272/273 = 0 (integer division),
causing the job to incorrectly fail even with 99%+ success.

The fix: cast to float64 before division:
  float64(successAndSkipped)/float64(imageJob.Status.Desired)

Also fixes the log output which had the same integer division bug.

Fixes eraser-dev#1163

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@AruneshDwivedi
AruneshDwivedi force-pushed the fix/issue-1163-integer-division branch from 3a07d39 to be6d070 Compare August 12, 2026 09:00
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.

[BUG] Success Rate Incorrect - says 0%

1 participant