minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

No cycle start / end time in `mc admin scanner status` when in "between cycles" state #4954

Closed rc5hack closed 4 months ago

rc5hack commented 4 months ago

Expected behavior

mc admin scanner status always shows current full scan cycle / last cycle start / end time

Actual behavior

mc admin scanner status only shows current full scan cycle start time, and shows no time info when in "between cycles"

Okay:

# mc admin scanner status my-bucket-name
Scanner Activity: ∙●∙

Overall Statistics
------------------
Last full scan time:   0d0h15m; Estimated 2836.00/month
Current cycle:         39066; Started: 2024-06-09 10:46:16.481258083 +0000 UTC
Active drives:         1

Last Minute Statistics
----------------------
[...]

Not okay:

# mc admin scanner status my-bucket-name

Overall Statistics
------------------
Last full scan time:   0d0h42m; Estimated 1016.99/month
Current cycle:         (between cycles)
Active drives:         0

Last Minute Statistics
----------------------
[...]

What I expect:

# mc admin scanner status my-bucket-name

Overall Statistics
------------------
Last full scan time: 0d0h42m; Estimated 1016.99/month
Current cycle:       (between cycles)
Last cycle:          XXXXX; Started: 2024-06-09 09:00:00.000000000 +0000 UTC; Ended: 2024-06-09 09:42:11.2342342340
Active drives:       0

Last Minute Statistics
----------------------
[...]

Steps to reproduce the behavior

mc admin scanner status my-bucket-name and by lucky chance end up in a "between cycles" state

mc --version

mc version RELEASE.2024-03-13T23-51-57Z (commit-id=2508db9c560c10be0ed2203eaa585134235b6907)

klauspost commented 4 months ago

We do not have any plans for this. You are welcome to send a PR. The data needed is already returned as CyclesCompletedAt.

If you decide to take it on, I'd prefer something like this:

Last full scan time: 0d0h42m; Estimated 1016.99/month
Last cycle duration: 0d0h13m; Ended: 2024-06-09 09:42:11.
Current cycle:  ( ... as before)