Git Product home page Git Product logo

Comments (15)

vbauerster avatar vbauerster commented on May 23, 2024

Hi! How do you increment? If it is io operation, do you use ProxyReader?

from mpb.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

Hi! thank you very much for your response.
Sorry for this late response!

Yes I use ProxyReader

from mpb.

vbauerster avatar vbauerster commented on May 23, 2024

Try higher number for EwmaETA decorator, if issue is still relevant.

from mpb.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

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.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

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.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

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.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

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.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

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.

pierre-emmanuelJ avatar pierre-emmanuelJ commented on May 23, 2024

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.

vbauerster avatar vbauerster commented on May 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.