hansel 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/hansel.gemspec +1 -1
- data/lib/arg_parser.rb +32 -48
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/hansel.gemspec
CHANGED
data/lib/arg_parser.rb
CHANGED
@@ -28,86 +28,70 @@ module Hansel
|
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def server_options options
|
32
32
|
options.on("-s", "--server=S",
|
33
|
-
|
34
|
-
@options.server =
|
33
|
+
"Specifies the IP hostname of the server.") do |server|
|
34
|
+
@options.server = server
|
35
35
|
end
|
36
|
-
end
|
37
36
|
|
38
|
-
def port options
|
39
37
|
options.on("-p", "--port=N",
|
40
|
-
|
41
|
-
@options.port =
|
38
|
+
"Specifies the port number on which the server is listening.") do |port|
|
39
|
+
@options.port = port
|
42
40
|
end
|
43
|
-
end
|
44
41
|
|
45
|
-
def uri options
|
46
42
|
options.on("-u", "--uri=S",
|
47
|
-
|
48
|
-
@options.uri =
|
43
|
+
"Specifies that URI S should be accessed on the server.") do |uri|
|
44
|
+
@options.uri = uri
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
52
|
-
def
|
48
|
+
def httperf_options options
|
53
49
|
options.on("-n", "--num_conns=N",
|
54
|
-
|
55
|
-
@options.num_conns =
|
50
|
+
"Specifies the total number of connections to create.") do |num_conns|
|
51
|
+
@options.num_conns = num_conns
|
56
52
|
end
|
57
|
-
end
|
58
53
|
|
59
|
-
def low_rate options
|
60
54
|
options.on("-l", "--low_rate=S",
|
61
|
-
|
62
|
-
@options.low_rate =
|
55
|
+
"Specifies the starting fixed rate at which connections are created.") do |low_rate|
|
56
|
+
@options.low_rate = low_rate
|
63
57
|
end
|
64
|
-
end
|
65
58
|
|
66
|
-
def high_rate options
|
67
59
|
options.on("-l", "--high_rate=S",
|
68
|
-
|
69
|
-
@options.high_rate =
|
60
|
+
"Specifies the ending fixed rate at which connections are created.") do |high_rate|
|
61
|
+
@options.high_rate = high_rate
|
70
62
|
end
|
71
|
-
end
|
72
63
|
|
73
|
-
def rate_step options
|
74
64
|
options.on("-l", "--rate_step=S",
|
75
|
-
|
76
|
-
@options.rate_step =
|
65
|
+
"Specifies the fixed rate step at which connections are created.") do |rate_step|
|
66
|
+
@options.rate_step = rate_step
|
77
67
|
end
|
78
68
|
end
|
79
69
|
|
80
|
-
def
|
81
|
-
options.on("-
|
82
|
-
|
70
|
+
def output_options options
|
71
|
+
options.on("-f", "--format=FORMAT [yaml|csv|octave]",
|
72
|
+
"Specify an output format.") do |format|
|
73
|
+
@options.output_format = format.to_sym
|
83
74
|
end
|
84
|
-
end
|
85
75
|
|
86
|
-
|
87
|
-
|
88
|
-
@options.output_format = opt.to_sym
|
76
|
+
options.on("-o", "--output=FILE", "Specify an output file.") do |output|
|
77
|
+
@options.output = output
|
89
78
|
end
|
90
|
-
end
|
91
79
|
|
92
|
-
|
93
|
-
|
94
|
-
@options.
|
80
|
+
options.on("-d", "--output_dir=PATH",
|
81
|
+
"Specify an output directory.") do |output_dir|
|
82
|
+
@options.output_dir = output_dir
|
95
83
|
end
|
96
84
|
end
|
97
85
|
|
98
|
-
def
|
99
|
-
options.on("-
|
100
|
-
@options.
|
86
|
+
def other_options options
|
87
|
+
options.on("-c", "--cookie=C", "Specify a cookie.") do |cookie|
|
88
|
+
@options.cookie = cookie
|
101
89
|
end
|
102
|
-
end
|
103
90
|
|
104
|
-
|
105
|
-
|
106
|
-
@options.verbose = opt
|
91
|
+
options.on("-v", "--[no-]verbose", "Run verbosely") do |verbose|
|
92
|
+
@options.verbose = verbose
|
107
93
|
end
|
108
|
-
end
|
109
94
|
|
110
|
-
def help options
|
111
95
|
options.on_tail("-h", "--help", "Show this message") do
|
112
96
|
puts options
|
113
97
|
@options.exit = true
|
@@ -124,8 +108,8 @@ module Hansel
|
|
124
108
|
def parse_options options
|
125
109
|
options.banner = "Usage: hansel [options]"
|
126
110
|
options.separator "Options:"
|
127
|
-
%w(
|
128
|
-
|
111
|
+
%w(server_options httperf_options output_options
|
112
|
+
other_options version).map(&:to_sym).each do |method|
|
129
113
|
self.send method, options
|
130
114
|
end
|
131
115
|
end
|