alive-progress icon indicating copy to clipboard operation
alive-progress copied to clipboard

Is there a way to query the stats()

Open MakeHer opened this issue 2 years ago • 4 comments

Loving this library. However, I'm wondering if I can use it to query the eta or stats so I can use it with other methods of reporting like, say, a notifier.

with alive_bar(len(stuff)) as bar:
    notifier.send_msg(f"Started process")
    for item in list(stuff):
        bar()
        if bar.current == 10: # after the first 10 steps give an eta
          notifier.send_msg(bar.stats())
    notifier.send_msg(f"Process finished")

MakeHer avatar Jun 06 '22 06:06 MakeHer

Hey, thank you!

Humm, that's a very interesting use... I do have all this info, but they are not externalized anywhere. I surely can publish them for you, gonna think about it 👍

rsalmei avatar Jun 07 '22 03:06 rsalmei

Does it work for you if I externalize the internal eta (either its string rendition, or the raw number of seconds), together with the rate (either rendered or raw too)? Those are the components of the stats widget.

rsalmei avatar Jun 10 '22 05:06 rsalmei

Those two would be perfect. Appreciate you looking into this.

On Fri, 10 June 2022, 3:26 pm Rogério Sampaio de Almeida, < @.***> wrote:

Does it work for you if I externalize the internal eta (either its string rendition, or the raw number of seconds), together with the rate (either rendered or raw too)? Those are the components of the stats widget.

— Reply to this email directly, view it on GitHub https://github.com/rsalmei/alive-progress/issues/166#issuecomment-1151957740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5FLMWGMQSOZZW4UGPJR4TVOLGZLANCNFSM5X6MECPA . You are receiving this because you authored the thread.Message ID: @.***>

MakeHer avatar Jun 10 '22 06:06 MakeHer

You're welcome. It's done, it will be included in the next release!

image

rsalmei avatar Jun 12 '22 18:06 rsalmei