Coder Social home page Coder Social logo

piotrmurach / tty-progressbar Goto Github PK

View Code? Open in Web Editor NEW
418.0 7.0 24.0 464 KB

Display a single or multiple progress bars in the terminal.

Home Page: https://ttytoolkit.org

License: MIT License

Ruby 100.00%
progressbar tty terminal tty-components console-tool rubygem frequency interval

tty-progressbar's People

Contributors

d4be4st avatar dannyben avatar denisdefreyne avatar doudou avatar drbrain avatar hyfen avatar piotrmurach avatar sleewoo avatar squarism avatar ttilberg avatar yegorov avatar zverok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tty-progressbar's Issues

Error if "complete" is Unicode

Using Unicode in the complete option breaks it with a negative array size error.

# encoding: UTF-8
# frozen_string_literal: true

require 'tty-progressbar'

p = TTY::ProgressBar.new(':title [:bar] :percent :eta',
  incomplete: '〜',head: '語',complete: '本',total: 100,width: 33)

p.start()

0.upto(5) do
  sleep(1)
  p.advance(3)
end

p.finish()

It will produce this error:

Traceback (most recent call last):
 ...
 9: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar.rb:360:in `finish'
 8: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar.rb:284:in `render'
 7: from ~/.rubies/ruby-2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `decorate'
 6: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/pipeline.rb:34:in `decorate'
 5: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/pipeline.rb:34:in `inject'
 4: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/pipeline.rb:34:in `each'
 3: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/pipeline.rb:37:in `block in decorate'
 2: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/formatter/bar.rb:48:in `format'
 1: from ~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/formatter/bar.rb:48:in `new'
~/.gem/ruby/2.7.0/gems/tty-progressbar-0.17.0/lib/tty/progressbar/formatter/bar.rb:48:in `initialize': negative array size (ArgumentError)

If you change complete to English, it works fine.

Environment

  • Ruby 2.7.0p0 (2019-12-25 revision 647ee6f091)
  • TTY::ProgressBar v0.17.0

ProgressBar#iterate vs LazyEnumerator

I am not sure whether it is a frequent use case, but I've thought that iterate is exact match for it... But it isn't.

Imagine this:

sleepy = Enumerator.new { |y| 
  loop do
    do_something
    sleep(10)
  end
}
# Now, each call of sleepy.next does something, then sleeps. And it is forever!
# The reasonable usage is like:
partial_result = sleepy.take(10)

# Now, I expected that this is "natural":
partial_result = TTY::ProgressBar.new('[:bar:]').iterate(sleepy).to_a

...but, as iterate tries to get collection's count, everything goes sideways here. Probably, having an optional total_count argument could be useful?

Add support for centered, overlay text

Describe the problem

I'm using the multi and it works great. However, I'm wondering if it would be possible to add support for centered, overlay text? For example, I have a pipeline with many steps, however, some of them can be skipped and I'd like to denote that in the progress. Something like this:

# ┌ main  [■■■■■■■■■■■■■□□□□□□□□□□] 50%
# ├── one [■■■■■■■■Skipped■■■■■■■■] 100%
# └── two [■■■■■■■■■■■■□□□□□□□□□□□] 50%

How would the new feature work?

If this capability doesn't already exist, there would need to be a new method which performs the action with the text input. Something like:

progress_bar_download.overlay('Skipped', align: :center)

Drawbacks

This may be too tedious to implement.

Naming and design

Hi, it's me again :D

I'd just like to kindly suggest that having a file named lib/tty-progressbar.rb is an anti-pattern, and also, a class called ProgressBar should be in a file called progress_bar.rb not progressbar.rb. Additionally, rather than overloading progress bar to be a spinner, you might want to have an entirely separate class. I think it's a nicer design.

Just some general feedback. Really useful gem.

Progress bar crashes on terminal resize

Running the progress bar from the example docs. Resize the terminal while the progress is going.
Tried iTerm and OSX terminal, same result.

~/.rubies/ruby-2.1.6/lib/ruby/2.1.0/monitor.rb:246:in `mon_check_owner': current thread not owner (ThreadError)
    from ~/.rubies/ruby-2.1.6/lib/ruby/2.1.0/monitor.rb:195:in `mon_exit'
    from ~/.rubies/ruby-2.1.6/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:143:in `ensure in require'
    from ~/.rubies/ruby-2.1.6/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:143:in `require'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen/size.rb:47:in `try_io_console'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen/size.rb:38:in `from_io_console'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen/size.rb:22:in `size'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen.rb:45:in `size'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen.rb:26:in `size'
    from ~/.gem/ruby/2.1.6/gems/tty-screen-0.5.0/lib/tty/screen.rb:31:in `width'
    from ~/.gem/ruby/2.1.6/gems/tty-progressbar-0.8.0/lib/tty/progressbar.rb:266:in `max_columns'
    from ~/.gem/ruby/2.1.6/gems/tty-progressbar-0.8.0/lib/tty/progressbar.rb:289:in `block in register_callbacks'
    from tty_time.rb:5:in `call'
    from tty_time.rb:5:in `sleep'
    from tty_time.rb:5:in `block in <main>'
    from tty_time.rb:4:in `times'
    from tty_time.rb:4:in `<main>'

I was poking around to find more behavior but ran out of time.

Inconsistency in expectations between ProgressBar#advance and Meter#sample

I started to use tty-progressbar to do a byte-related progress, but noticed really weird rates (not matching at all the overall mean rates I would calculate)

So far, I am assuming that when using the _rate tokens, one should get a rate calculation while passing actual units (not units per second) to ProgressBar's #advance and #current= methods.

From reading the code and the specs, it seems that Meter#sample expects to be given a rate (NOT an absolute advance). I say that since it's only averaging the sampled values instead of taking into account the sampling times.

But ProgressBar#advance is passing an absolute progress (in unit, not in unit/s).

I would propose a PR fixing this, but I'm not sure whether the "right" fix is to change Meter or ProgressBar (IMO, Meter could be changed to do more interesting things with rate calculations). If you're OK with it, I would change ProgressBar#sample to take the time and the absolute value (instead of progress) and update Meter to take into account the sample's time.

When using `hide_cursor`, it remains hidden on premature exit

Issue

When using hide_cursor, if the user presses Ctrl+C (or the progress bar is otherwise interrupted prematurely), then the cursor stays hidden.

One workaround I found, is to call bar.stop in some ensure block, like so:

require 'tty-progressbar'

begin
  bar = TTY::ProgressBar.new("downloading [:bar]", total: 30, hide_cursor: true)
  
  30.times do
    sleep(0.1)
    bar.advance(1)
  end

ensure
  bar.stop

end

But this feels like it should be the library's responsibility, not the user's.

Reproduction steps

Run this, and press Ctrl+C before it finishes.

require 'tty-progressbar'
bar = TTY::ProgressBar.new("downloading [:bar]", total: 30, hide_cursor: true)
  
30.times do
  sleep(0.1)
  bar.advance(1)
end

Actual behaviour

The cursor stays hidden after termination.

Expected behaviour

The cursor should revert to its visible state after termination.

Proposed solution

Perhaps something along these lines can work?

Change this:

def render
return if done?
if hide_cursor && @last_render_width == 0 && !(@current >= total)
write(TTY::Cursor.hide)
end

to this:

       if hide_cursor && @last_render_width == 0 && !(@current >= total)
         write(TTY::Cursor.hide)
+        at_exit { stop }
       end

There is probably a better candidate than at_exit, but this is the simplest idea I could come up with.

A way to use custom incomplete tokens

Let's say I have a bunch of things to compute. If a computation fails, I'd like to show its result in the associated progressbar. For example:

files = ['file1', 'file2']
bar = TTY::ProgressBar.new("Downloading: [:bar]", total: files.size)
files.each do |f|
  result = download_file(f)
  result_token = result ? '.' : 'x'
  bar.advance(1, result_token)
end

A possible output:

Downloading: [. ]
Downloading: [.x]

I can make a PR if you find the idea useful.

ETA on a new release?

I see a few nice things like the bar_format option that has not yet made its way to a release + I noticed the latest release is from over a year ago.

Would love to have a new version published soon.

TTY::ProgressBar::Multi finishes too early

Hi!

First of all: nice gem! Unfortunately i found an issue when i tried it out: I changed your TTY::ProgressBar::Multi example by adding a third sub-progressbar with a different total than the other two:

require 'tty-progressbar'

bars = TTY::ProgressBar::Multi.new("main [:bar] :percent")

bar1 = bars.register("one [:bar] :percent", total: 15)
bar2 = bars.register("two [:bar] :percent", total: 15)
bar3 = bars.register("thr [:bar] :percent", total: 45)

bars.start

th1 = Thread.new { 15.times { sleep(0.1); bar1.advance } }
th2 = Thread.new { 15.times { sleep(0.1); bar2.advance } }
th3 = Thread.new { 45.times { sleep(0.1); bar3.advance } }

[th1, th2, th3].each { |t| t.join }

That consistently (unless by coincidence the scheduling gives me the same result every time) gives me the following output:

ruby progressbar.rb
┌ main [===========================================================================] 100%
├── thr [================                             ] 38%
├── two [===============] 100%
└── one [===============] 100%

Hope this helps :)

Be aware of Unicode width

Progress Bar sometimes can have Unicode characters, such as CJKs from a file name.

Consider computing unicode width instead of string length, if unicode-display_width gem is loaded.

(Or use other equivalent strategies.)

Thank you for tty-progressbar

Hey Piotr!

I just wanted to thank you for creating tty-progressbar! It really helped us in a complex database migration that we had at work recently, it was so incredibly convenient to have all of these features available:

  • ETA display
  • rate display
  • logging
  • frequency option
  • interval option

Just wanted to let you know that it worked great for us, and thank you for all your awesome work! ❤️

Performance issues?

This seems super weird, but when I use progress.advance(1), I get a bunch of syscalls:

215.06 connection/s [========================================================================================================================================  ] 986/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.64 connection/s [========================================================================================================================================  ] 987/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.74 connection/s [========================================================================================================================================  ] 988/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.69 connection/s [========================================================================================================================================  ] 989/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.71 connection/s [========================================================================================================================================= ] 990/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.61 connection/s [========================================================================================================================================= ] 991/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
214.54 connection/s [========================================================================================================================================= ] 992/1000 ( 0s/ 4s)openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-1.24.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/console-1.8.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nio4r-2.5.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.2/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/timers-4.3.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-io-1.27.3/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-pool-0.2.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http1-0.10.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/async-http-0.50.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http-0.13.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-http2-0.10.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-hpack-1.4.2/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/protocol-websocket-0.7.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mapping-1.1.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/samovar-2.1.4/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/strings-ansi-0.1.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.17.0/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-cursor-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/tty-screen-0.7.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/unicode-display_width-1.6.1/lib/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/site_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/vendor_ruby/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/ruby/2.7.0/fiddle.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 16
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/samuel/.rbenv/versions/2.7.0/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 16
openat(AT_FDCWD, "/usr/lib/kernel32", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Do you have any require statement embedded in code at some point? Removing the progress bar = no more syscalls of this nature.

Option `no_width` should be documented in README.md

In certain situations, we might not know total in advance but we might still want to display a progress bar that shows the current count and elapsed count.

I was going to create an issue and start working on PR for this but then I noticed that there's an option called no_width that addresses this already. Is there a reason it's not in the README? I could take a stab at documenting it. I also noticed that some of the formatters rely on having total available to them.

Adding MultiBar logging

Hi! 👋 Firstly, THANK YOU FOR THESE AMAZING GEMS! The TTY suite is exceptional.

Describe the problem

When using TTY::ProgressBar::Multi, logging with each registered bar results in corrupted output.

Steps to reproduce the problem

multi_bar = TTY::ProgressBar::Multi.new("Example [:bar] :percent", total: examples.count)

bars = [
    multi_bar.register("Thread 1 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 2 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 3 [:bar] :percent", total: examples.count / 4),
    multi_bar.register("Thread 4 [:bar] :percent", total: examples.count / 4)
]

Parallel.each(examples) do 
    bars[Parallel.worker_number].log "Something"
end

Actual behaviour

The previous logs are overwritten:

├── Thread 6 [= ] 50%[email protected]' (1912) updated
├── Thread 7 [= ] 50%[email protected]' (1911) updated
├── Thread 4 [= ] 50%[email protected]' (1913) updated
├── Thread 5 [= ] 50%super.com' (1915) updated
├── Thread 0 [= ] 50%[email protected]' (1608) updated
├── Thread 3 [= ] 50%[email protected]' (1874) updateded

Expected behaviour

Logging is printed above the multibar

Describe your environment

  • OS version: Mac OS Mojave
  • Ruby version: 2.6.6 something
  • TTY::ProgressBar version: 0.18.0

Time left indication

New feature request

This is a very useful gem. Have you considered adding the facility to provide a 'time left' indicator?

It should be possible to track the rate of progress of the bar, test if it is approximately linear, and if so, provide on ongoing indicator of the actual time left? You could also try to fit models other than linear.

Although it may take some time for me to get around to it, I would be prepared to prototype such a feature.

Broken multi progress bar

If the width option is specified for a child bar and this option is smaller than the total option of this child bar, the main bar breaks in two lines.

For example run this code:

#!/usr/bin/env ruby

require 'tty-progressbar'

bars = TTY::ProgressBar::Multi.new("main [:bar] :percent")

bar1 = bars.register "foo [:bar] :percent", total: 50, width: 20
bar2 = bars.register "bar [:bar] :percent", total: 200, width: 20
bar3 = bars.register "baz [:bar] :percent", total: 100, width: 20

th1 = Thread.new { 50.times { sleep(0.05); bar1.advance } }
th2 = Thread.new { 200.times { sleep(0.05); bar2.advance } }
th3 = Thread.new { 100.times { sleep(0.02); bar3.advance } }

[th1, th2, th3].each(&:join)

There is a workaround:

#!/usr/bin/env ruby

require 'tty-progressbar'

module TTY
  class ProgressBar
    class Multi
      def register(format, options = {})
        observable = options.delete(:observable) { true }
        bar = TTY::ProgressBar.new(format, @options.merge(options))

        synchronize do
          bar.attach_to(self)
          @bars << bar
          observe(bar) if observable
          if @top_bar
            width = total
            width = options[:width] if options[:width] 
            @top_bar.update(total: total, width: width)
          end
        end

        bar
      end
    end
  end 
end

bars = TTY::ProgressBar::Multi.new("main [:bar] :percent")

bar1 = bars.register "foo [:bar] :percent", total: 50, width: 20
bar2 = bars.register "bar [:bar] :percent", total: 200, width: 20
bar3 = bars.register "baz [:bar] :percent", total: 100, width: 20

th1 = Thread.new { 50.times { sleep(0.05); bar1.advance } }
th2 = Thread.new { 200.times { sleep(0.05); bar2.advance } }
th3 = Thread.new { 100.times { sleep(0.02); bar3.advance } }

[th1, th2, th3].each(&:join)

Tested on ubuntu 16.04 ruby version 2.3.1p112

Consider start/reset

Right now the start_at time on the ProgressBar is set once the counter advances from zero. It would be nice to have more control over this as the eta and elapsed time could be wrong (the time shouldn't necessarily start when the progress advances past).

p = TTY::ProgressBar.new("[:bar]", total: 100)
p.start # Draws the bar @0% progress and initializes the start_at property
p.advance(50) # Draws the bar @50% progress
p.reset # Resets the progress bar @0% progress
p.advance(50) # Draws the bar @50% progress
p.finish # Draws the bar @100% progress and finishes it

Multi progress bar does not update drawing current / total values properly

Describe the problem

Multi progress bar's top_bar does not update drawing current / total values properly with registering new child bars.

Steps to reproduce the problem

require 'bundler/inline'

gemfile true do
  source 'http://rubygems.org'
  gem 'tty-progressbar'
end

class FetchPackages
  def run
    @multibar = TTY::ProgressBar::Multi.new('Fetching packages (:current/:total)')
    validate_local_cache
    fetch
  end

  def validate_local_cache
    bar = @multibar.register('Validating local cache', total: 1)
    sleep 2
    bar.advance
  end

  def fetch
    bar = @multibar.register('Fetching :percent (:current/:total)', total: 20)
    20.times do
      sleep 0.5
      bar.advance
    end
  end
end

FetchPackages.new.run

Actual behaviour

┌ Fetching packages (1/1)
└── Validating local cache
└── Fetching 100% (20/20)

Expected behaviour

┌ Fetching packages (21/21)
├── Validating local cache
└── Fetching 100% (20/20)

Describe your environment

  • OS version: Docker container from official Docker image ruby:2.7.0
  • Ruby version: 2.7.0
  • TTY::ProgressBar version: 0.17.0

May break on CTRL+C

When I interrupt my script with CTRL+C, it seems that tty-progressbar goes through #require which is forbidden in trap context

Backtrace

/home/doudou/.rbenv/versions/2.3.1/lib/ruby/2.3.0/monitor.rb:187:in `lock': can't be called from trap context (ThreadError)
        from /home/doudou/.rbenv/versions/2.3.1/lib/ruby/2.3.0/monitor.rb:187:in `mon_enter'
        from /home/doudou/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen/size.rb:49:in `try_io_console'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen/size.rb:37:in `from_io_console'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen/size.rb:21:in `size'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen.rb:46:in `size'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen.rb:28:in `size'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-screen-0.4.3/lib/tty/screen.rb:33:in `width'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-progressbar-0.7.0/lib/tty/progressbar.rb:266:in `max_columns'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/tty-progressbar-0.7.0/lib/tty/progressbar.rb:289:in `block in register_callbacks'
        from /home/doudou/dev/flat_fish/tools/pocolog/lib/pocolog/file.rb:739:in `read'
        from /home/doudou/dev/flat_fish/tools/pocolog/lib/pocolog/file.rb:739:in `data_header'
        from /home/doudou/dev/flat_fish/tools/pocolog/lib/pocolog/data_reader.rb:307:in `advance'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/file_upgrader.rb:62:in `block in upgrade'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/file_upgrader.rb:28:in `each'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/file_upgrader.rb:28:in `upgrade'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/cli.rb:39:in `block in upgrade'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/cli.rb:30:in `each'
        from /home/doudou/dev/flat_fish/tools/log_tools/lib/log_tools/cli.rb:30:in `upgrade'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/doudou/.autoproj/gems/ruby/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/doudou/dev/flat_fish/tools/log_tools/bin/rock-log:3:in `<main>'

parallel multiple progress bars possible ?

I would like to ask if it's possible with tty-progressbar to display multiple progress bars at the same time from multiple processes. For example, something like :

downloading file1 [=======================       ]
downloading file2 [======                        ]
downloading file3 [=============                 ]
downloading file4 [==========                    ]

Thanks

strings-ansi gem version conflict with other latest tty gems

Are you in the right place?

  • For issues or feature requests file a GitHub issue in this repository
  • For general questions or discussion post in Gitter

Describe the problem

A brief description of the issue/feature.

Hi, I tried using tty-progressbar in a project of mine and mix it with another project using the latest versions of tty-markdown and tty-prompt, and a gem conflict occurred that forced me to downgrade them to accommodate strings-ansi '~> 0.1.0' (from 0.2)

I just saw you have changed the dependency to `~> 0.2', which would resolve my issue.

My only question is when will you be making the next release? And, if not soon, would you be able to make a quick patch release in the meantime with only that dependency change?

Describe your environment

  • OS version: Mac Catalina
  • Ruby version: Ruby 2.7.1 and JRuby 9.2.13.0
  • TTY::ProgressBar version: 0.17.0

thread safe?

Is a TTY:Progressbar threadsafe, can I share an instance between multiple threads, all of which call advance on it?

Indeterminate MultiBars raise `undefined method `+' for nil:NilClass`

Describe the problem

Upon multibar registration, the parent's total is recalculated. This raises:

NoMethodError: undefined method `+' for nil:NilClass

I'll submit a PR to fix.

Steps to reproduce the problem

require 'tty/progressbar/multi'

main = TTY::ProgressBar::Multi.new("All the things: :current")
bars = Hash.new { |hash, key| hash[key] = main.register("#{key}: :current") }

5.times do |i|
  100.times do
    sleep 0.01
    bars["Thing #{i}"].advance
  end
end

Actual behaviour

/Users/ttilberg/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/tty-progressbar-0.18.1/lib/tty/progressbar/multi.rb:145:in `each': undefined method `+' for nil:NilClass (NoMethodError)

Expected behaviour

▶ ruby multi.rb
┌ Total: 500
└── Thing 0: 100
└── Thing 1: 100
└── Thing 2: 100
└── Thing 3: 100
└── Thing 4: 100

Describe your environment

  • OS version: MacOS 10.15.7
  • Ruby version: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
  • TTY::ProgressBar version: 0.18.1

`log` feature ala ruby-progressbar

Sometimes while a progress bar is in progress, you want to output some status or log information.

ruby-progressbar has a log feature that will let you print some lines to the screen , without completely messing up the painting of the still-in-progress progress bar. https://github.com/jfelchner/ruby-progressbar/wiki/Logging

tty-progressbar appears not to have this feature? It's a crucial one.

Came up on on a /r/ruby question. https://www.reddit.com/r/ruby/comments/9nhos9/suggest_a_pretty_command_line_program_toolkit/

Consider :average_speed and :bytes_per_second formatter

These would be very useful for seeing the speed (as many people who use this library would likely use it for displaying download progress) e.g. "1.32MB/s".

If #6 is implemented, adding the :average_speed token would be trivial.

NaN FloatDomainError when using the :eta marker in v0.18.0

Describe the problem

After upgrading from 0.17.0 to 0.18.0, I started receiving NaN (FloatDomainError) exceptions.
I tracked it to the :eta marker.

Steps to reproduce the problem

Save this self-contained ruby file and run it.

require 'bundler/inline'

gemfile do
  source "https://rubygems.org"
  
  gem 'tty-progressbar', '0.18.0'     # BROKEN
  # gem 'tty-progressbar', '0.17.0'   # OK
end

def progress_bar(text, count)
  # BROKEN
  TTY::ProgressBar.new "#{text} :bar ETA :eta", total: count

  # OK
  # TTY::ProgressBar.new "#{text} :bar", total: count
end

total = 50
bar = progress_bar "downloading", total
total.times do |i|
  bar.log "Working on #{i}/#{total}"
  sleep 0.1
  bar.advance
end

Actual behaviour

Exception raised:

/store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/converter.rb:18:in `floor': NaN (FloatDomainError)
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/converter.rb:18:in `to_time'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/formatter/estimated.rb:28:in `call'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/pipeline.rb:44:in `block in decorate'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/pipeline.rb:42:in `each'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/pipeline.rb:42:in `inject'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar/pipeline.rb:42:in `decorate'
        from /usr/share/rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/forwardable.rb:238:in `decorate'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar.rb:345:in `render'
        from /store/gems/ruby-3.0.0/gems/tty-progressbar-0.18.0/lib/tty/progressbar.rb:555:in `log'
        from test.rb:20:in `block in <main>'
        from test.rb:19:in `times'
        from test.rb:19:in `<main>'

Expected behaviour

It is expected to work as version 0.17.0, not crash and respect the :eta marker.

Describe your environment

  • OS version: 18.04.5 LTS (Bionic Beaver)
  • Ruby version: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
  • TTY::ProgressBar version: 0.18.0

Disable auto-finish

Describe the problem

So I was hoping to use this gem to show the current status of a buffer in progress bar form. I know the maximum size, so this isn't indeterminate.

My problem? If the buffer gets full, the bar finishes, and there's no way to stop it.

I thought of just adding one to total or something, but that would throw the percentage and bar progress off.

How would the new feature work?

I was thinking an auto_finish: false option, which is checked when currently the bar ends if current == total.

Drawbacks

Can you see any potential drawbacks?

Would need to handle cases where current is set to something > total, but that wouldn't be hard.

Interrupt not working with tty-progressbar

If I using tty-progressbar CTRL+C key combination not working, it doesn't stop application at all.

Steps to reproduce:

  1. Run application with tty-progressbar
  2. Try to use CTRL+C

Expected results:
Application interrupt

Mismatched gem dependencies on tty-screen

Hi! Thanks for providing this gem. I wanted to let you know that c3e2221 causes problems when installing the tty gem, producing output like the following:

ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: tty requires tty-screen (~> 0.1.0); tty-progressbar requires tty-screen (~> 0.2.0); tty-table requires tty-screen (~> 0.1)

Is it possible to get them all in sync? I can also resolve this by updating my gem file to require a previous version of tty, but I wasn't sure if you'd seen this error.

Progressbar crashed when terminal size change

If progressbar is finished and terminal size is changed:

tty-progressbar-0.8.1/lib/tty/progressbar.rb:188:in `resize'
tty-progressbar-0.8.1/lib/tty/progressbar.rb:309:in `block in register_signals'

Add something like :byte_total/:total_byte formatter

First off, love the library, couldn't be much easier to use. I'm presenting a download progress bar and I'd like to show the current download progress in something like "1.1MB/3.4MB" and currently the :total token uses the total bytes. I think this might be a common enough use case to bake a new formatter into the library?

A way to decorate enumerable with progressbar

I'm not sure whether it aligns with the gem's purpose, but I think it would be quite nice to have a built-in function wrapping an enumerable with a progressbar, so instead of manually advancing a progressbar with every iteration:

bar = TTY::ProgressBar.new("downloading [:bar]", total: 30)
30.times do
  sleep(0.1)
  bar.advance(1)
end

one could just call something like:
with_bar(enumerable).map { |v| computation(v) }

An example of a simple with_bar implementation:

def with_bar(ary)
  Enumerator.new do |y|
    bar = TTY::ProgressBar.new('[:bar]', total: ary.size)
    ary.each do |e|
      bar.advance(1)
      y << e
    end
  end
end

Perhaps with_bar should take another argument, so one could customize a progressbar.

What do you think?

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.