elbping 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/elbping/cli.rb +7 -3
  2. metadata +1 -1
data/lib/elbping/cli.rb CHANGED
@@ -16,6 +16,7 @@ module ElbPing
16
16
  OPTIONS[:count] = ENV['PING_ELB_PINGCOUNT'] || 0
17
17
  OPTIONS[:timeout] = ENV['PING_ELB_TIMEOUT'] || 10
18
18
  OPTIONS[:wait] = ENV['PING_ELB_WAIT'] || 0
19
+ OPTIONS[:port] = ENV['PING_ELB_PORT'] || 80
19
20
 
20
21
  # Build parser for command line options
21
22
  PARSER = OptionParser.new do |opts|
@@ -41,6 +42,10 @@ module ElbPing
41
42
  "Ping each node COUNT times (default: #{OPTIONS[:count]})") do |n|
42
43
  OPTIONS[:count] = n
43
44
  end
45
+ opts.on("-p PORT", "--port PORT", Integer,
46
+ "Port to send requests to (default: #{OPTIONS[:port]})") do |n|
47
+ OPTIONS[:port] = n
48
+ end
44
49
  end
45
50
 
46
51
  # Parse options
@@ -64,8 +69,6 @@ module ElbPing
64
69
 
65
70
  # Catch ctrl-c
66
71
  trap("SIGINT") {
67
- #ElbPing::Display.summary(total_summary, node_summary)
68
- #exit!
69
72
  run = false
70
73
  }
71
74
 
@@ -95,7 +98,8 @@ module ElbPing
95
98
  nodes.map { |node|
96
99
  total_summary[:reqs_attempted] += 1
97
100
  node_summary[node][:reqs_attempted] += 1
98
- status = ElbPing::HttpPinger.ping_node(node, OPTIONS[:verb_len], OPTIONS[:timeout])
101
+ status = ElbPing::HttpPinger.ping_node(node,
102
+ OPTIONS[:verb_len], OPTIONS[:timeout], OPTIONS[:port])
99
103
 
100
104
  unless status[:code] == :timeout
101
105
  total_summary[:reqs_completed] += 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elbping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: