Comments (15)
Hi! How do you increment? If it is io operation, do you use ProxyReader?
from mpb.
Hi! thank you very much for your response.
Sorry for this late response!
Yes I use ProxyReader
from mpb.
Try higher number for EwmaETA decorator, if issue is still relevant.
from mpb.
I have tried to change EwmaETA style and put a bigger number but it's doesn't working sorry.
I use version v3.3.2
from mpb.
It's hard to say what's wrong with your code, provided snippet says nothing. Example which is using EwmaETA decorator, works as expected in v3.3.2
:
https://asciinema.org/a/UcxMzSPNdlyRMckkBgNnZQ806
from mpb.
It's work very nice ETA too BUT:
when I want to replace the time with "done" at the end with this following code:
mpb.AppendDecorators(
// replace ETA decorator with "done" message, OnComplete event
decor.OnComplete(
// ETA decorator with ewma age of 60
decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
),
),
So when I add this code Time doesn't working anymore example:
https://asciinema.org/a/0zx1oHlqpDJuIash5eQaXN8Os
and if I add this code:
mpb.AppendDecorators(
decor.AverageETA(decor.ET_STYLE_GO),
// replace ETA decorator with "done" message, OnComplete event
decor.OnComplete(
// ETA decorator with ewma age of 60
decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
),
),
I get this:
https://asciinema.org/a/PJejQBd8T3DiPKyU0WfJH19Mw
Then if I remove the decor.OnComplete
I can do what I want perfectly but without done at the end 😢
Example:
https://asciinema.org/a/rbC6xMkFlFGdrLmpMMNoeAmOc
from mpb.
Can you please paste full code sample where it doesn't work for you? As I mentioned before, example code has the same combination: decor.EmwaETA
wrapped inside decor.OnComplete
and both do work.
from mpb.
This is the full code:
https://github.com/exoscale/cli/blob/master/cmd/sos_upload.go
I have explained to you just earlier the different cases.
Thank you
from mpb.
Ok, if I understood correctly, your problem is when you wrap any eta decorator into OnComplete
, you got zero value 0s
always. And when you use it without OnComplete
it is ok. Is that correct?
If so, I cannot reproduce such behaviour.
Here I use both eta wrapped into OnComplete
:
bar := p.AddBar(size,
mpb.PrependDecorators(
decor.CountersKibiByte("% 6.1f / % 6.1f"),
),
mpb.AppendDecorators(
decor.Name("ewma: "),
decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_MMSS, float64(size)/2048), "done!"),
decor.Name(" avg: "),
decor.OnComplete(decor.AverageETA(decor.ET_STYLE_GO), "done!"),
decor.Name(" ] "),
decor.AverageSpeed(decor.UnitKiB, "% .2f"),
),
)
The output as expected:
https://asciinema.org/a/dUskQrJ1JnHp9qxI0miYXLSop
https://asciinema.org/a/pGOz7pLvLLUXKvJJ4yOzTOayR
from mpb.
yes it was that 👍
🎉 OKAY I have solved my problem by using:
decor.OnComplete(decor.AverageETA(decor.ET_STYLE_GO), "done!"),
in AppendDecorators
instead of:
decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_GO, 60), "done"),
in AppendDecorators
Do you think it's come from the proxy reader? because for you it's working with both solution
ps: I have tried to replace 60
with my file size
from mpb.
Do you think it's come from the proxy reader?
No. I think it is how underlying ewma lib works.
Wen you use age > 0, it uses VariableEWMA, which requires some "warmup", before it displays something other than zero.
from mpb.
Wen you use age > 0, it uses VariableEWMA, which requires some "warmup", before it displays something other than zero.
I have tried with very big file to prevent the "warmup" but with no success 😢
Thank you very much for your help 😸
from mpb.
You're welcome! By the way, I don't recommend passing full size to EwmaETA age param, instead divide your size to something other than zero ;) Good candidate is buffer size.
from mpb.
You're welcome! By the way, I don't recommend passing full size to EwmaETA age param, instead divide your size to something other than zero ;) Good candidate is buffer size.
yes thanks you but for me EwmaETA
doesn't working as I said earlier!
I have tried with very big file to prevent the "warmup" but with no success 😢
I think you dont't understand my reply so I have modified it.
I think there is a real problem with EwmaETA
.
So now I only use AverageETA
and It's okay for me
from mpb.
@pierre-emmanuelJ
This line seems to be part of the culprit. You suppose to pass a wrapped (proxy) reader everywhere, where io.Reader
is expected, otherwise there is no guarantee that EwmaETA
will work at all.
from mpb.
Related Issues (20)
- Add support for ReadSeeker for uploads to s3 HOT 5
- Memory leak HOT 5
- Please expose ProxyWriter to public API by analogy with Proxy reader HOT 1
- Panic when calling bar.DecoratorEwmaUpdate inside goroutine HOT 2
- Any option to print logs below progress bar, without progress bar getting duplicated? HOT 3
- if not a TTY, mpb still output control characters HOT 2
- [bytes counter] when use EwmaSpeed ,speed and remain time calculate is wrong? HOT 4
- [QUESTION] Bar doesn't display right info.
- Bug: Bars are not completely removed HOT 3
- Leading white space not removable? HOT 2
- DynTotal with EWMA question HOT 1
- Adding color to one bar on abort adds colors to others in barExtenderRev example HOT 1
- Cannot show up progress bar at Goland terminal console HOT 1
- Ineffective breaks in heap_manager.go HOT 3
- Using Frogbot to scan this repository
- WithWaitGroup hangs on error. Help explain how to use WithWaitGroup. HOT 3
- SetTotal not working with complex bar HOT 1
- Progress.Wait() exits without waiting for Progress.Write() to complete HOT 7
- Invalid rate calculation HOT 2
- bar.Abort should not cause the bar to render if the render delay hasn't expired HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpb.