rfuzz 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +18 -17
- data/Rakefile +8 -3
- data/doc/rdoc/classes/RFuzz/Browser.html +229 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000068.html +25 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000069.html +23 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000070.html +24 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.html +10 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000010.html +10 -10
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000011.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000012.html +36 -35
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000013.html +35 -35
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000014.html +43 -43
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000015.html +22 -22
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000016.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000017.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000018.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000019.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.html +13 -0
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000001.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000002.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000003.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000004.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000005.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000006.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000007.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000008.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000009.html +18 -18
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000044.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000045.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000046.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000047.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000048.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000049.html +3 -3
- data/doc/rdoc/classes/RFuzz/Session.html +11 -1
- data/doc/rdoc/classes/RFuzz/Session.src/M000020.html +16 -16
- data/doc/rdoc/classes/RFuzz/Session.src/M000021.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000022.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000023.html +20 -20
- data/doc/rdoc/classes/RFuzz/Session.src/M000024.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000025.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000026.html +12 -12
- data/doc/rdoc/classes/RFuzz/Session.src/M000027.html +15 -15
- data/doc/rdoc/classes/RFuzz/Session.src/M000028.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000029.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000030.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000031.html +9 -9
- data/doc/rdoc/classes/RFuzz.html +5 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +1 -1
- data/doc/rdoc/files/LICENSE.html +1 -1
- data/doc/rdoc/files/README.html +23 -24
- data/doc/rdoc/files/lib/rfuzz/browser_rb.html +109 -0
- data/doc/rdoc/files/lib/rfuzz/client_rb.html +2 -1
- data/doc/rdoc/files/lib/rfuzz/random_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/rfuzz_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/session_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/stats_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +9 -6
- data/examples/cl_watcher.rb +36 -0
- data/examples/mongrel_test_suite/test/http/access_authentication.rb +8 -0
- data/examples/mongrel_test_suite/test/http/appendix.rb +76 -0
- data/examples/mongrel_test_suite/test/http/base_protocol.rb +4 -7
- data/examples/mongrel_test_suite/test/http/caching_in_http.rb +140 -0
- data/examples/mongrel_test_suite/test/http/connections.rb +48 -0
- data/examples/mongrel_test_suite/test/http/content_negotiation.rb +20 -0
- data/examples/mongrel_test_suite/test/http/entity.rb +24 -0
- data/examples/mongrel_test_suite/test/http/header_field_definitions.rb +231 -0
- data/examples/mongrel_test_suite/test/http/http_message.rb +122 -0
- data/examples/mongrel_test_suite/test/http/method_definitions.rb +52 -0
- data/examples/mongrel_test_suite/test/http/protocol_parameters.rb +286 -0
- data/examples/mongrel_test_suite/test/http/request.rb +28 -0
- data/examples/mongrel_test_suite/test/http/response.rb +20 -0
- data/examples/mongrel_test_suite/test/http/security_considerations.rb +54 -0
- data/examples/mongrel_test_suite/test/http/status_code_definitions.rb +192 -0
- data/ext/fuzzrnd/fuzzrnd.c +1 -2
- data/lib/rfuzz/browser.rb +53 -0
- data/lib/rfuzz/client.rb +11 -6
- data/lib/rfuzz/session.rb +3 -1
- data/tools/rakehelp.rb +4 -2
- metadata +24 -15
- data/test/coverage/index.html +0 -388
- data/test/coverage/lib-rfuzz-client_rb.html +0 -1127
- data/test/coverage/lib-rfuzz-random_rb.html +0 -739
- data/test/coverage/lib-rfuzz-session_rb.html +0 -783
- data/test/coverage/lib-rfuzz-stats_rb.html +0 -788
- data/test/server.rb +0 -101
- data/test/test_client.rb +0 -164
- data/test/test_fuzzrnd.rb +0 -31
- data/test/test_httpparser.rb +0 -48
- data/test/test_random.rb +0 -75
- data/test/test_session.rb +0 -33
- data/test/test_stats.rb +0 -45
@@ -10,23 +10,23 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 85</span>
|
14
|
+
85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_query</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">query</span>)
|
15
|
+
86: <span class="ruby-identifier">params</span> = []
|
16
|
+
87:
|
17
|
+
88: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">query</span>
|
18
|
+
89: <span class="ruby-identifier">query</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
19
|
+
90: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
|
20
|
+
91: <span class="ruby-identifier">v</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">params</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">encode_param</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">x</span>) }
|
21
|
+
92: <span class="ruby-keyword kw">else</span>
|
22
|
+
93: <span class="ruby-identifier">params</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">encode_param</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
23
|
+
94: <span class="ruby-keyword kw">end</span>
|
24
|
+
95: <span class="ruby-keyword kw">end</span>
|
25
|
+
96:
|
26
|
+
97: <span class="ruby-identifier">uri</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"?"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'&'</span>)
|
27
|
+
98: <span class="ruby-keyword kw">end</span>
|
28
|
+
99:
|
29
|
+
100: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri</span>
|
30
|
+
101: <span class="ruby-keyword kw">end</span></pre>
|
31
31
|
</body>
|
32
32
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 106</span>
|
14
|
+
106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_host</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
|
15
|
+
107: <span class="ruby-node">"#{host}"</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">!=</span> <span class="ruby-value">80</span> <span class="ruby-operator">?</span> <span class="ruby-node">":#{port}"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">""</span>)
|
16
|
+
108: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,11 +10,11 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 113</span>
|
14
|
+
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">s</span>)
|
15
|
+
114: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([^ a-zA-Z0-9_.-]+)/n</span>) {
|
16
|
+
115: <span class="ruby-value str">'%'</span><span class="ruby-operator">+</span><span class="ruby-identifier">$1</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'H2'</span><span class="ruby-operator">*</span><span class="ruby-identifier">$1</span>.<span class="ruby-identifier">size</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">'%'</span>).<span class="ruby-identifier">upcase</span>
|
17
|
+
116: }.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">' '</span>, <span class="ruby-value str">'+'</span>)
|
18
|
+
117: <span class="ruby-keyword kw">end</span></pre>
|
19
19
|
</body>
|
20
20
|
</html>
|
@@ -10,11 +10,11 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 121</span>
|
14
|
+
121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">s</span>)
|
15
|
+
122: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">'+'</span>, <span class="ruby-value str">' '</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/((?:%[0-9a-fA-F]{2})+)/n</span>){
|
16
|
+
123: [<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'%'</span>)].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'H*'</span>)
|
17
|
+
124: }
|
18
|
+
125: <span class="ruby-keyword kw">end</span></pre>
|
19
19
|
</body>
|
20
20
|
</html>
|
@@ -10,23 +10,23 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 131</span>
|
14
|
+
131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_parse</span>(<span class="ruby-identifier">qs</span>, <span class="ruby-identifier">d</span> = <span class="ruby-value str">'&;'</span>)
|
15
|
+
132: <span class="ruby-identifier">params</span> = {}
|
16
|
+
133: (<span class="ruby-identifier">qs</span><span class="ruby-operator">||</span><span class="ruby-value str">''</span>).<span class="ruby-identifier">split</span>(<span class="ruby-node">/[#{d}] */n</span>).<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">params</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
17
|
+
134: <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>=<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">p</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">'='</span>,<span class="ruby-value">2</span>)
|
18
|
+
135: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cur</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">k</span>]
|
19
|
+
136: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cur</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Array</span>
|
20
|
+
137: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">v</span>
|
21
|
+
138: <span class="ruby-keyword kw">else</span>
|
22
|
+
139: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">k</span>] = [<span class="ruby-identifier">cur</span>, <span class="ruby-identifier">v</span>]
|
23
|
+
140: <span class="ruby-keyword kw">end</span>
|
24
|
+
141: <span class="ruby-keyword kw">else</span>
|
25
|
+
142: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
26
|
+
143: <span class="ruby-keyword kw">end</span>
|
27
|
+
144: }
|
28
|
+
145:
|
29
|
+
146: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">params</span>
|
30
|
+
147: <span class="ruby-keyword kw">end</span></pre>
|
31
31
|
</body>
|
32
32
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 476</span>
|
14
|
+
476: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connect</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
477: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 482</span>
|
14
|
+
482: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_request</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
483: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 488</span>
|
14
|
+
488: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
489: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 492</span>
|
14
|
+
492: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_header</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
493: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 496</span>
|
14
|
+
496: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_body</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
497: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
14
|
-
|
15
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 500</span>
|
14
|
+
500: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>(<span class="ruby-identifier">state</span>)
|
15
|
+
501: <span class="ruby-keyword kw">end</span></pre>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -126,11 +126,21 @@ activity.
|
|
126
126
|
|
127
127
|
<div class="name-list">
|
128
128
|
<table>
|
129
|
+
<tr class="top-aligned-row context-row">
|
130
|
+
<td class="context-item-name">client</td>
|
131
|
+
<td class="context-item-value"> [R] </td>
|
132
|
+
<td class="context-item-desc"></td>
|
133
|
+
</tr>
|
129
134
|
<tr class="top-aligned-row context-row">
|
130
135
|
<td class="context-item-name">counts</td>
|
131
136
|
<td class="context-item-value"> [RW] </td>
|
132
137
|
<td class="context-item-desc"></td>
|
133
138
|
</tr>
|
139
|
+
<tr class="top-aligned-row context-row">
|
140
|
+
<td class="context-item-name">rand</td>
|
141
|
+
<td class="context-item-value"> [R] </td>
|
142
|
+
<td class="context-item-desc"></td>
|
143
|
+
</tr>
|
134
144
|
<tr class="top-aligned-row context-row">
|
135
145
|
<td class="context-item-name">runs</td>
|
136
146
|
<td class="context-item-value"> [RW] </td>
|
@@ -280,7 +290,7 @@ output. Use Session#counts to access the counts directly.
|
|
280
290
|
<div class="method-heading">
|
281
291
|
<a href="Session.src/M000023.html" target="Code" class="method-signature"
|
282
292
|
onclick="popupCode('Session.src/M000023.html');return false;">
|
283
|
-
<span class="method-name">run</span><span class="method-args">(count, options={}) {|@client, @rand| ...}</span>
|
293
|
+
<span class="method-name">run</span><span class="method-args">(count=1, options={}) {|@client, @rand| ...}</span>
|
284
294
|
</a>
|
285
295
|
</div>
|
286
296
|
|
@@ -10,22 +10,22 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
32:
|
21
|
-
33: <span class="ruby-ivar">@word_file</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:words</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">".."</span>, <span class="ruby-value str">".."</span>, <span class="ruby-value str">"resources"</span>,<span class="ruby-value str">"words.txt"</span>)
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 28</span>
|
14
|
+
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>={})
|
15
|
+
29: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:host</span>]
|
16
|
+
30: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:port</span>]
|
17
|
+
31: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:host</span>)
|
18
|
+
32: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:port</span>)
|
19
|
+
33: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:notifier</span>] = <span class="ruby-constant">StatsTracker</span>.<span class="ruby-identifier">new</span>
|
22
20
|
34:
|
23
|
-
35: <span class="ruby-ivar">@
|
24
|
-
36:
|
25
|
-
37:
|
26
|
-
38: <span class="ruby-ivar">@
|
27
|
-
39:
|
28
|
-
40: <span class="ruby-ivar">@
|
29
|
-
41:
|
21
|
+
35: <span class="ruby-ivar">@word_file</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:words</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">".."</span>, <span class="ruby-value str">".."</span>, <span class="ruby-value str">"resources"</span>,<span class="ruby-value str">"words.txt"</span>)
|
22
|
+
36:
|
23
|
+
37: <span class="ruby-ivar">@client</span> = <span class="ruby-constant">HttpClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@port</span>, <span class="ruby-identifier">options</span>)
|
24
|
+
38: <span class="ruby-ivar">@rand</span> = <span class="ruby-constant">RandomGenerator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">open</span>(<span class="ruby-ivar">@word_file</span>).<span class="ruby-identifier">read</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"\n"</span>))
|
25
|
+
39:
|
26
|
+
40: <span class="ruby-ivar">@runs</span> = []
|
27
|
+
41: <span class="ruby-ivar">@counts</span> = []
|
28
|
+
42: <span class="ruby-ivar">@tracking</span> = []
|
29
|
+
43: <span class="ruby-keyword kw">end</span></pre>
|
30
30
|
</body>
|
31
31
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 45</span>
|
14
|
+
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cur_run</span>
|
15
|
+
46: <span class="ruby-ivar">@runs</span>.<span class="ruby-identifier">last</span>
|
16
|
+
47: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 49</span>
|
14
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cur_count</span>
|
15
|
+
50: <span class="ruby-ivar">@counts</span>.<span class="ruby-identifier">last</span>
|
16
|
+
51: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,25 +10,25 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 61</span>
|
14
|
+
61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">count</span>=<span class="ruby-value">1</span>, <span class="ruby-identifier">options</span>={})
|
15
|
+
62: <span class="ruby-identifier">sample</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:sample</span>] <span class="ruby-operator">||</span> [<span class="ruby-identifier">:request</span>]
|
16
|
+
63: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
17
|
+
64: <span class="ruby-comment cmt"># setup for this latest sample run</span>
|
18
|
+
65: <span class="ruby-ivar">@runs</span> <span class="ruby-operator"><<</span> {}
|
19
|
+
66: <span class="ruby-ivar">@counts</span> <span class="ruby-operator"><<</span> {}
|
20
|
+
67: <span class="ruby-ivar">@tracking</span> <span class="ruby-operator"><<</span> {}
|
21
|
+
68: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@client</span>, <span class="ruby-ivar">@rand</span>
|
22
|
+
69:
|
23
|
+
70: <span class="ruby-comment cmt"># record the request stats then reset them</span>
|
24
|
+
71: <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cur_run</span>[<span class="ruby-identifier">s</span>] = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">notifier</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">clone</span> }
|
25
|
+
72: <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">notifier</span>.<span class="ruby-identifier">reset</span>
|
26
|
+
73: <span class="ruby-keyword kw">end</span>
|
27
|
+
74:
|
28
|
+
75: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:save_as</span>]
|
29
|
+
76: <span class="ruby-identifier">write_runs</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:save_as</span>][<span class="ruby-value">0</span>])
|
30
|
+
77: <span class="ruby-identifier">write_counts</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:save_as</span>][<span class="ruby-value">1</span>])
|
31
|
+
78: <span class="ruby-keyword kw">end</span>
|
32
|
+
79: <span class="ruby-keyword kw">end</span></pre>
|
33
33
|
</body>
|
34
34
|
</html>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 83</span>
|
14
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sample</span>(<span class="ruby-identifier">stat</span>,<span class="ruby-identifier">count</span>)
|
15
|
+
84: <span class="ruby-identifier">cur_run</span>[<span class="ruby-identifier">stat</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Sampler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">stat</span>)
|
16
|
+
85: <span class="ruby-identifier">cur_run</span>[<span class="ruby-identifier">stat</span>].<span class="ruby-identifier">sample</span>(<span class="ruby-identifier">count</span>)
|
17
|
+
86: <span class="ruby-keyword kw">end</span></pre>
|
18
18
|
</body>
|
19
19
|
</html>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 89</span>
|
14
|
+
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count</span>(<span class="ruby-identifier">stat</span>,<span class="ruby-identifier">count</span>=<span class="ruby-value">1</span>)
|
15
|
+
90: <span class="ruby-identifier">cur_count</span>[<span class="ruby-identifier">stat</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
|
16
|
+
91: <span class="ruby-identifier">cur_count</span>[<span class="ruby-identifier">stat</span>] <span class="ruby-operator">+=</span> <span class="ruby-identifier">count</span>
|
17
|
+
92: <span class="ruby-keyword kw">end</span></pre>
|
18
18
|
</body>
|
19
19
|
</html>
|
@@ -10,17 +10,17 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 97</span>
|
14
|
+
97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">runs_to_a</span>(<span class="ruby-identifier">headers</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
+
98: <span class="ruby-identifier">keys</span> = [<span class="ruby-value str">"run"</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Sampler</span>.<span class="ruby-identifier">keys</span>
|
16
|
+
99: <span class="ruby-identifier">results</span> = []
|
17
|
+
100: <span class="ruby-identifier">results</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">keys</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
|
18
|
+
101:
|
19
|
+
102: <span class="ruby-ivar">@runs</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">run</span><span class="ruby-operator">|</span>
|
20
|
+
103: <span class="ruby-ivar">@runs</span>[<span class="ruby-identifier">run</span>].<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">stats</span><span class="ruby-operator">|</span> <span class="ruby-identifier">results</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">run</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">stats</span>.<span class="ruby-identifier">values</span> }
|
21
|
+
104: <span class="ruby-keyword kw">end</span>
|
22
|
+
105:
|
23
|
+
106: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
|
24
|
+
107: <span class="ruby-keyword kw">end</span></pre>
|
25
25
|
</body>
|
26
26
|
</html>
|
@@ -10,20 +10,20 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 111</span>
|
14
|
+
111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">counts_to_a</span>(<span class="ruby-identifier">headers</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
+
112: <span class="ruby-identifier">keys</span> = <span class="ruby-ivar">@counts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">keys</span>
|
16
|
+
113: <span class="ruby-identifier">results</span> = []
|
17
|
+
114: <span class="ruby-identifier">results</span> <span class="ruby-operator"><<</span> [<span class="ruby-value str">"run"</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">keys</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
|
18
|
+
115:
|
19
|
+
116: <span class="ruby-ivar">@counts</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">run</span><span class="ruby-operator">|</span>
|
20
|
+
117: <span class="ruby-identifier">results</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">run</span>]
|
21
|
+
118: <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
22
|
+
119: <span class="ruby-identifier">results</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@counts</span>[<span class="ruby-identifier">run</span>][<span class="ruby-identifier">k</span>]
|
23
|
+
120: <span class="ruby-keyword kw">end</span>
|
24
|
+
121: <span class="ruby-keyword kw">end</span>
|
25
|
+
122:
|
26
|
+
123: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
|
27
|
+
124: <span class="ruby-keyword kw">end</span></pre>
|
28
28
|
</body>
|
29
29
|
</html>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 130</span>
|
14
|
+
130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">track</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">value</span>)
|
15
|
+
131: <span class="ruby-ivar">@tracking</span>.<span class="ruby-identifier">last</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> []
|
16
|
+
132: <span class="ruby-ivar">@tracking</span>.<span class="ruby-identifier">last</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span>
|
17
|
+
133: <span class="ruby-keyword kw">end</span></pre>
|
18
18
|
</body>
|
19
19
|
</html>
|