cocoindex icon indicating copy to clipboard operation
cocoindex copied to clipboard

[FEATURE] Show processing rate in the last 1 minute in console

Open badmonster0 opened this issue 8 months ago • 3 comments

When we report progress (code), we want to show the processing rate during last 1 minute.

It doesn't have to be exactly 1 minute. A good enough way is to piggyback on the existing tick on stats report (code), record (time, count) on each tick, and look back to find the latest record that is 1 min ago (or the first record). Use the "delta of counter / delta of duration" to calculate the rate. Example:

00:00:00, 0 00:00:21, 15 <- rate=15/21 00:00:40, 32 <- rate=32/40 00:00:61, 50 <- rate = 50/61 00:00:81, 77 <- rate = (77-15)/(81-21)

We can show it in the bracket together with elapsed time, e.g. [elapsed: 32s, 2.231/s now]. Please show 3 digits after ..


To contributors ❤️: Please leave a comment I'm working on this if you decide to take it - to better communicate with other contributors :)

badmonster0 avatar Apr 18 '25 23:04 badmonster0