Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress additional text at speed section incorrect work #207

Closed
dmitryk-dk opened this issue Jul 11, 2023 · 2 comments · Fixed by #208
Closed

Progress additional text at speed section incorrect work #207

dmitryk-dk opened this issue Jul 11, 2023 · 2 comments · Fixed by #208

Comments

@dmitryk-dk
Copy link
Contributor

Hi! We have an issue regarding adding additional symbol if width of the text lower that it was before.
For example:
I have next template

const pbTpl = `{{ (cycle . "←" "↖" "↑" "↗" "→" "↘" "↓" "↙" ) }} {{speed . "%s samples/s"}}`

This template is used in the next code:

pbPrefix := fmt.Sprintf(`{{ green "VM worker %d:" }}`, i)
bar = barpool.AddWithTemplate(pbPrefix+pbTpl, 0)

where

// AddWithTemplate adds bar with the given template
// to the global pool
func AddWithTemplate(format string, total int) *pb.ProgressBar {
	tpl := getTemplate(format)
	bar := pb.ProgressBarTemplate(tpl).New(total)
	Add(bar)
	return bar
}

When I start the tool it shows the correct text like

VM worker 0: → 3233 samples/s

but when when the number of characters decreases, then an additional character appears at the end of the line

VM worker 0: → 323 samples/ss
VM worker 0: → 32 samples/sss

Is it possible to fix this behavior?
Related issue you can find here: VictoriaMetrics/VictoriaMetrics#4555

@cheggaaa
Copy link
Owner

Hi!
It looks like it does not redraw the whole line, so I think I'll fix it

@cheggaaa
Copy link
Owner

v3.1.3 created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants