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

More relevant duration #2

Closed
Qwertyn opened this issue Jun 18, 2015 · 2 comments
Closed

More relevant duration #2

Qwertyn opened this issue Jun 18, 2015 · 2 comments

Comments

@Qwertyn
Copy link

Qwertyn commented Jun 18, 2015

If end_time calculate a little earlier, the duration would be more relevant.

# lib/net/ping/external.rb
...
Open3.popen3(*pcmd) do |stdin, stdout, stderr, thread|
  stdin.close
  @end_time = Time.now # <-------
  err = stderr.gets # Can't chomp yet, might be nil
...
# There is no duration if the ping failed
@duration = @end_time - start_time if bool
...

What it can be fraught with?
(What negative consequences can be?)

@chernesk
Copy link
Collaborator

I'm looking into this. Thank you for the submission.

@chernesk
Copy link
Collaborator

Sorry that this has taken so long to respond to. I have tried a number of scenarios with your suggestion and they all seem to work correctly.

Merged.

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

No branches or pull requests

2 participants