Skip to content

Conversation

@rafael-pissardo
Copy link

How it is:

image
image

For big number we lost visibility

How I would like to see:

image
image

@rafael-pissardo
Copy link
Author

@rosa what do you think about it?

@rosa
Copy link
Member

rosa commented Jul 11, 2025

Hey @rafael-pissardo, thanks for this, but I'm not sure this works 🤔 The case where we show ... is when we can't count the number of jobs efficiently.

You are calling ActiveJob.jobs.with_status(status).count, which returns Float::INFINITY when the query can't be done efficiently because it's over the count limit. This is going to show Total finished jobs: Infinity, I think.

@rafael-pissardo
Copy link
Author

Hi @rosa , thanks for the feedback — you were absolutely right about the Float::INFINITY case.

I’ve updated the code so that, instead of showing Infinity, it now displays MissionControl::Jobs.count_limit plus a suffix when the count can’t be computed efficiently, while still formatting the number for regular counts using:

number_to_human(value, format: "%n%u", units: units) + suffix

Let me know if this matches the intended behavior.

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.

2 participants