srvmonitor 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,6 +50,7 @@ module SrvMonitor
50
50
  @response_time = (Time.now - previous_time) * 1000 # Miliseconds
51
51
  @response_code = response.code.to_i
52
52
  @response_body = response.body
53
+ end
53
54
  rescue Timeout::Error
54
55
  @response_time = (Time.now - previous_time).round
55
56
  @response_code = @response_body = nil
@@ -61,11 +62,12 @@ module SrvMonitor
61
62
  def remote_exec
62
63
  previous_time = Time.now
63
64
  Timeout::timeout(@timeout) do
64
- server.exec do |ssh|
65
- response = ssh.exec!("curl --write-out %{http_code}:%{time_total} --silent --output /dev/null #{ url }")
66
- @response_code = response.split(':').first.to_i
67
- @response_time = response.split(':').last.to_f * 1000
68
- @response_body = ssh.exec!("curl #{ url }")
65
+ server.exec do |ssh|
66
+ response = ssh.exec!("curl --write-out %{http_code}:%{time_total} --silent --output /dev/null #{ url }")
67
+ @response_code = response.split(':').first.to_i
68
+ @response_time = response.split(':').last.to_f * 1000
69
+ @response_body = ssh.exec!("curl #{ url }")
70
+ end
69
71
  end
70
72
  rescue Timeout::Error
71
73
  @response_time = (Time.now - previous_time).round
@@ -1,5 +1,5 @@
1
1
  module SrvMonitor
2
- PATCH = 2
2
+ PATCH = 3
3
3
  MINOR = 0
4
4
  MAJOR = 0
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}".freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: srvmonitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: