rfuzz 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/COPYING +55 -0
  2. data/LICENSE +55 -0
  3. data/README +252 -0
  4. data/Rakefile +48 -0
  5. data/doc/rdoc/classes/RFuzz.html +146 -0
  6. data/doc/rdoc/classes/RFuzz/HttpClient.html +481 -0
  7. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000010.html +24 -0
  8. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000011.html +34 -0
  9. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000012.html +49 -0
  10. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000013.html +49 -0
  11. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000014.html +57 -0
  12. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000015.html +37 -0
  13. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000016.html +26 -0
  14. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000017.html +34 -0
  15. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000018.html +18 -0
  16. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000019.html +26 -0
  17. data/doc/rdoc/classes/RFuzz/HttpEncoding.html +294 -0
  18. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000001.html +26 -0
  19. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000002.html +18 -0
  20. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000003.html +26 -0
  21. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000004.html +18 -0
  22. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000005.html +32 -0
  23. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000006.html +18 -0
  24. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000007.html +20 -0
  25. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000008.html +20 -0
  26. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000009.html +32 -0
  27. data/doc/rdoc/classes/RFuzz/HttpResponse.html +180 -0
  28. data/doc/rdoc/classes/RFuzz/Notifier.html +252 -0
  29. data/doc/rdoc/classes/RFuzz/Notifier.src/M000044.html +17 -0
  30. data/doc/rdoc/classes/RFuzz/Notifier.src/M000045.html +17 -0
  31. data/doc/rdoc/classes/RFuzz/Notifier.src/M000046.html +17 -0
  32. data/doc/rdoc/classes/RFuzz/Notifier.src/M000047.html +17 -0
  33. data/doc/rdoc/classes/RFuzz/Notifier.src/M000048.html +17 -0
  34. data/doc/rdoc/classes/RFuzz/Notifier.src/M000049.html +17 -0
  35. data/doc/rdoc/classes/RFuzz/RandomGenerator.html +362 -0
  36. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000032.html +21 -0
  37. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000033.html +23 -0
  38. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000036.html +22 -0
  39. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000037.html +20 -0
  40. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000038.html +22 -0
  41. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000039.html +20 -0
  42. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000040.html +18 -0
  43. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000041.html +18 -0
  44. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000042.html +22 -0
  45. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/M000043.html +18 -0
  46. data/doc/rdoc/classes/RFuzz/Sampler.html +383 -0
  47. data/doc/rdoc/classes/RFuzz/Sampler.src/M000056.html +19 -0
  48. data/doc/rdoc/classes/RFuzz/Sampler.src/M000057.html +23 -0
  49. data/doc/rdoc/classes/RFuzz/Sampler.src/M000058.html +26 -0
  50. data/doc/rdoc/classes/RFuzz/Sampler.src/M000059.html +18 -0
  51. data/doc/rdoc/classes/RFuzz/Sampler.src/M000060.html +18 -0
  52. data/doc/rdoc/classes/RFuzz/Sampler.src/M000061.html +18 -0
  53. data/doc/rdoc/classes/RFuzz/Sampler.src/M000062.html +18 -0
  54. data/doc/rdoc/classes/RFuzz/Sampler.src/M000063.html +19 -0
  55. data/doc/rdoc/classes/RFuzz/Sampler.src/M000064.html +18 -0
  56. data/doc/rdoc/classes/RFuzz/Sampler.src/M000065.html +23 -0
  57. data/doc/rdoc/classes/RFuzz/Sampler.src/M000066.html +18 -0
  58. data/doc/rdoc/classes/RFuzz/Sampler.src/M000067.html +20 -0
  59. data/doc/rdoc/classes/RFuzz/Session.html +415 -0
  60. data/doc/rdoc/classes/RFuzz/Session.src/M000020.html +31 -0
  61. data/doc/rdoc/classes/RFuzz/Session.src/M000021.html +18 -0
  62. data/doc/rdoc/classes/RFuzz/Session.src/M000022.html +18 -0
  63. data/doc/rdoc/classes/RFuzz/Session.src/M000023.html +34 -0
  64. data/doc/rdoc/classes/RFuzz/Session.src/M000024.html +19 -0
  65. data/doc/rdoc/classes/RFuzz/Session.src/M000025.html +19 -0
  66. data/doc/rdoc/classes/RFuzz/Session.src/M000026.html +26 -0
  67. data/doc/rdoc/classes/RFuzz/Session.src/M000027.html +29 -0
  68. data/doc/rdoc/classes/RFuzz/Session.src/M000028.html +19 -0
  69. data/doc/rdoc/classes/RFuzz/Session.src/M000029.html +18 -0
  70. data/doc/rdoc/classes/RFuzz/Session.src/M000030.html +18 -0
  71. data/doc/rdoc/classes/RFuzz/Session.src/M000031.html +23 -0
  72. data/doc/rdoc/classes/RFuzz/StatsTracker.html +242 -0
  73. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000050.html +19 -0
  74. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000051.html +19 -0
  75. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000052.html +18 -0
  76. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000053.html +18 -0
  77. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000054.html +28 -0
  78. data/doc/rdoc/classes/RFuzz/StatsTracker.src/M000055.html +18 -0
  79. data/doc/rdoc/created.rid +1 -0
  80. data/doc/rdoc/files/COPYING.html +168 -0
  81. data/doc/rdoc/files/LICENSE.html +168 -0
  82. data/doc/rdoc/files/README.html +473 -0
  83. data/doc/rdoc/files/lib/rfuzz/client_rb.html +111 -0
  84. data/doc/rdoc/files/lib/rfuzz/random_rb.html +116 -0
  85. data/doc/rdoc/files/lib/rfuzz/rfuzz_rb.html +109 -0
  86. data/doc/rdoc/files/lib/rfuzz/session_rb.html +111 -0
  87. data/doc/rdoc/files/lib/rfuzz/stats_rb.html +113 -0
  88. data/doc/rdoc/fr_class_index.html +35 -0
  89. data/doc/rdoc/fr_file_index.html +34 -0
  90. data/doc/rdoc/fr_method_index.html +93 -0
  91. data/doc/rdoc/index.html +24 -0
  92. data/doc/rdoc/rdoc-style.css +208 -0
  93. data/examples/amazon_headers.rb +38 -0
  94. data/examples/hpricot_pudding.rb +22 -0
  95. data/examples/kill_routes.rb +26 -0
  96. data/examples/mongrel_test_suite/lib/gen.rb +24 -0
  97. data/examples/mongrel_test_suite/test/camping/static_files.rb +9 -0
  98. data/examples/mongrel_test_suite/test/camping/upload_file.rb +9 -0
  99. data/examples/mongrel_test_suite/test/camping/upload_progress.rb +9 -0
  100. data/examples/mongrel_test_suite/test/http/base_protocol.rb +23 -0
  101. data/examples/mongrel_test_suite/test/nitro/upload_file.rb +9 -0
  102. data/examples/mongrel_test_suite/test/nitro/upload_progress.rb +9 -0
  103. data/examples/mongrel_test_suite/test/rails/static_files.rb +9 -0
  104. data/examples/mongrel_test_suite/test/rails/upload_file.rb +9 -0
  105. data/examples/mongrel_test_suite/test/rails/upload_progress.rb +9 -0
  106. data/examples/perftest.rb +30 -0
  107. data/ext/fuzzrnd/ext_help.h +14 -0
  108. data/ext/fuzzrnd/extconf.rb +6 -0
  109. data/ext/fuzzrnd/fuzzrnd.c +149 -0
  110. data/ext/http11_client/ext_help.h +14 -0
  111. data/ext/http11_client/extconf.rb +6 -0
  112. data/ext/http11_client/http11_client.c +288 -0
  113. data/ext/http11_client/http11_parser.c +629 -0
  114. data/ext/http11_client/http11_parser.h +46 -0
  115. data/ext/http11_client/http11_parser.rl +169 -0
  116. data/lib/rfuzz/client.rb +498 -0
  117. data/lib/rfuzz/random.rb +110 -0
  118. data/lib/rfuzz/rfuzz.rb +12 -0
  119. data/lib/rfuzz/session.rb +154 -0
  120. data/lib/rfuzz/stats.rb +159 -0
  121. data/resources/defaults.yaml +2 -0
  122. data/resources/words.txt +3310 -0
  123. data/test/coverage/index.html +388 -0
  124. data/test/coverage/lib-rfuzz-client_rb.html +1127 -0
  125. data/test/coverage/lib-rfuzz-random_rb.html +739 -0
  126. data/test/coverage/lib-rfuzz-session_rb.html +783 -0
  127. data/test/coverage/lib-rfuzz-stats_rb.html +788 -0
  128. data/test/server.rb +101 -0
  129. data/test/test_client.rb +164 -0
  130. data/test/test_fuzzrnd.rb +31 -0
  131. data/test/test_httpparser.rb +48 -0
  132. data/test/test_random.rb +75 -0
  133. data/test/test_session.rb +33 -0
  134. data/test/test_stats.rb +45 -0
  135. data/tools/rakehelp.rb +119 -0
  136. metadata +201 -0
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 26</span>
14
+ 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>={})
15
+ 27: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:host</span>]
16
+ 28: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:port</span>]
17
+ 29: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:host</span>)
18
+ 30: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:port</span>)
19
+ 31: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:notifier</span>] = <span class="ruby-constant">StatsTracker</span>.<span class="ruby-identifier">new</span>
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">&quot;..&quot;</span>, <span class="ruby-value str">&quot;..&quot;</span>, <span class="ruby-value str">&quot;resources&quot;</span>,<span class="ruby-value str">&quot;words.txt&quot;</span>)
22
+ 34:
23
+ 35: <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
+ 36: <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">&quot;\n&quot;</span>))
25
+ 37:
26
+ 38: <span class="ruby-ivar">@runs</span> = []
27
+ 39: <span class="ruby-ivar">@counts</span> = []
28
+ 40: <span class="ruby-ivar">@tracking</span> = []
29
+ 41: <span class="ruby-keyword kw">end</span></pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>cur_run (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 43</span>
14
+ 43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cur_run</span>
15
+ 44: <span class="ruby-ivar">@runs</span>.<span class="ruby-identifier">last</span>
16
+ 45: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>cur_count (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 47</span>
14
+ 47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cur_count</span>
15
+ 48: <span class="ruby-ivar">@counts</span>.<span class="ruby-identifier">last</span>
16
+ 49: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>run (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 59</span>
14
+ 59: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">count</span>, <span class="ruby-identifier">options</span>={})
15
+ 60: <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
+ 61: <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
+ 62: <span class="ruby-comment cmt"># setup for this latest sample run</span>
18
+ 63: <span class="ruby-ivar">@runs</span> <span class="ruby-operator">&lt;&lt;</span> {}
19
+ 64: <span class="ruby-ivar">@counts</span> <span class="ruby-operator">&lt;&lt;</span> {}
20
+ 65: <span class="ruby-ivar">@tracking</span> <span class="ruby-operator">&lt;&lt;</span> {}
21
+ 66: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@client</span>, <span class="ruby-ivar">@rand</span>
22
+ 67:
23
+ 68: <span class="ruby-comment cmt"># record the request stats then reset them</span>
24
+ 69: <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
+ 70: <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">notifier</span>.<span class="ruby-identifier">reset</span>
26
+ 71: <span class="ruby-keyword kw">end</span>
27
+ 72:
28
+ 73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:save_as</span>]
29
+ 74: <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
+ 75: <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
+ 76: <span class="ruby-keyword kw">end</span>
32
+ 77: <span class="ruby-keyword kw">end</span></pre>
33
+ </body>
34
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>sample (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 81</span>
14
+ 81: <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
+ 82: <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
+ 83: <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
+ 84: <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>count (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 87</span>
14
+ 87: <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
+ 88: <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
+ 89: <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
+ 90: <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>runs_to_a (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 95</span>
14
+ 95: <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
+ 96: <span class="ruby-identifier">keys</span> = [<span class="ruby-value str">&quot;run&quot;</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Sampler</span>.<span class="ruby-identifier">keys</span>
16
+ 97: <span class="ruby-identifier">results</span> = []
17
+ 98: <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">keys</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
18
+ 99:
19
+ 100: <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
+ 101: <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">&lt;&lt;</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
+ 102: <span class="ruby-keyword kw">end</span>
22
+ 103:
23
+ 104: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
24
+ 105: <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>counts_to_a (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 109</span>
14
+ 109: <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
+ 110: <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
+ 111: <span class="ruby-identifier">results</span> = []
17
+ 112: <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-value str">&quot;run&quot;</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
+ 113:
19
+ 114: <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
+ 115: <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">run</span>]
21
+ 116: <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
+ 117: <span class="ruby-identifier">results</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@counts</span>[<span class="ruby-identifier">run</span>][<span class="ruby-identifier">k</span>]
23
+ 118: <span class="ruby-keyword kw">end</span>
24
+ 119: <span class="ruby-keyword kw">end</span>
25
+ 120:
26
+ 121: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
27
+ 122: <span class="ruby-keyword kw">end</span></pre>
28
+ </body>
29
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>track (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 128</span>
14
+ 128: <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
+ 129: <span class="ruby-ivar">@tracking</span>.<span class="ruby-identifier">last</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> []
16
+ 130: <span class="ruby-ivar">@tracking</span>.<span class="ruby-identifier">last</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">value</span>
17
+ 131: <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>write_runs (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 134</span>
14
+ 134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_runs</span>(<span class="ruby-identifier">file</span>)
15
+ 135: <span class="ruby-constant">CSV</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>,<span class="ruby-value str">&quot;w&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">out</span><span class="ruby-operator">|</span> <span class="ruby-identifier">runs_to_a</span>(<span class="ruby-identifier">headers</span>=<span class="ruby-keyword kw">true</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">r</span> } }
16
+ 136: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>write_counts (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 139</span>
14
+ 139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_counts</span>(<span class="ruby-identifier">file</span>)
15
+ 140: <span class="ruby-constant">CSV</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>,<span class="ruby-value str">&quot;w&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">out</span><span class="ruby-operator">|</span> <span class="ruby-identifier">counts_to_a</span>(<span class="ruby-identifier">headers</span>=<span class="ruby-keyword kw">true</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">c</span> } }
16
+ 141: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>count_errors (RFuzz::Session)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/rfuzz/session.rb, line 145</span>
14
+ 145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count_errors</span>(<span class="ruby-identifier">as</span>)
15
+ 146: <span class="ruby-keyword kw">begin</span>
16
+ 147: <span class="ruby-keyword kw">yield</span>
17
+ 148: <span class="ruby-keyword kw">rescue</span>
18
+ 149: <span class="ruby-identifier">count</span> <span class="ruby-identifier">as</span>
19
+ 150: <span class="ruby-identifier">count</span> <span class="ruby-identifier">$!</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">&quot;:&quot;</span>,<span class="ruby-value str">&quot;&quot;</span>)
20
+ 151: <span class="ruby-keyword kw">end</span>
21
+ 152: <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,242 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: RFuzz::StatsTracker</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">RFuzz::StatsTracker</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/rfuzz/stats_rb.html">
59
+ lib/rfuzz/stats.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ When registered as the notifier for a client it tracks the times for each
84
+ part of the request. Rather than subclassing <a
85
+ href="Notifier.html">RFuzz::Notifier</a> it uses a <a
86
+ href="StatsTracker.html#M000054">method_missing</a> to record the even
87
+ timings.
88
+ </p>
89
+ <p>
90
+ You can dump it with <a href="StatsTracker.html#M000055">to_s</a>, or you
91
+ can access the StatsTracker.stats hash to read the <a
92
+ href="Sampler.html">RFuzz::Sampler</a> objects related to each event.
93
+ </p>
94
+
95
+ </div>
96
+
97
+
98
+ </div>
99
+
100
+ <div id="method-list">
101
+ <h3 class="section-bar">Methods</h3>
102
+
103
+ <div class="name-list">
104
+ <a href="#M000051">mark</a>&nbsp;&nbsp;
105
+ <a href="#M000054">method_missing</a>&nbsp;&nbsp;
106
+ <a href="#M000050">new</a>&nbsp;&nbsp;
107
+ <a href="#M000053">reset</a>&nbsp;&nbsp;
108
+ <a href="#M000052">sample</a>&nbsp;&nbsp;
109
+ <a href="#M000055">to_s</a>&nbsp;&nbsp;
110
+ </div>
111
+ </div>
112
+
113
+ </div>
114
+
115
+
116
+ <!-- if includes -->
117
+
118
+ <div id="section">
119
+
120
+
121
+
122
+
123
+
124
+ <div id="attribute-list">
125
+ <h3 class="section-bar">Attributes</h3>
126
+
127
+ <div class="name-list">
128
+ <table>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">stats</td>
131
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
132
+ <td class="context-item-desc"></td>
133
+ </tr>
134
+ </table>
135
+ </div>
136
+ </div>
137
+
138
+
139
+
140
+ <!-- if method_list -->
141
+ <div id="methods">
142
+ <h3 class="section-bar">Public Class methods</h3>
143
+
144
+ <div id="method-M000050" class="method-detail">
145
+ <a name="M000050"></a>
146
+
147
+ <div class="method-heading">
148
+ <a href="StatsTracker.src/M000050.html" target="Code" class="method-signature"
149
+ onclick="popupCode('StatsTracker.src/M000050.html');return false;">
150
+ <span class="method-name">new</span><span class="method-args">()</span>
151
+ </a>
152
+ </div>
153
+
154
+ <div class="method-description">
155
+ </div>
156
+ </div>
157
+
158
+ <h3 class="section-bar">Public Instance methods</h3>
159
+
160
+ <div id="method-M000051" class="method-detail">
161
+ <a name="M000051"></a>
162
+
163
+ <div class="method-heading">
164
+ <a href="StatsTracker.src/M000051.html" target="Code" class="method-signature"
165
+ onclick="popupCode('StatsTracker.src/M000051.html');return false;">
166
+ <span class="method-name">mark</span><span class="method-args">(event)</span>
167
+ </a>
168
+ </div>
169
+
170
+ <div class="method-description">
171
+ </div>
172
+ </div>
173
+
174
+ <div id="method-M000054" class="method-detail">
175
+ <a name="M000054"></a>
176
+
177
+ <div class="method-heading">
178
+ <a href="StatsTracker.src/M000054.html" target="Code" class="method-signature"
179
+ onclick="popupCode('StatsTracker.src/M000054.html');return false;">
180
+ <span class="method-name">method_missing</span><span class="method-args">(event, *args)</span>
181
+ </a>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+ </div>
186
+ </div>
187
+
188
+ <div id="method-M000053" class="method-detail">
189
+ <a name="M000053"></a>
190
+
191
+ <div class="method-heading">
192
+ <a href="StatsTracker.src/M000053.html" target="Code" class="method-signature"
193
+ onclick="popupCode('StatsTracker.src/M000053.html');return false;">
194
+ <span class="method-name">reset</span><span class="method-args">()</span>
195
+ </a>
196
+ </div>
197
+
198
+ <div class="method-description">
199
+ </div>
200
+ </div>
201
+
202
+ <div id="method-M000052" class="method-detail">
203
+ <a name="M000052"></a>
204
+
205
+ <div class="method-heading">
206
+ <a href="StatsTracker.src/M000052.html" target="Code" class="method-signature"
207
+ onclick="popupCode('StatsTracker.src/M000052.html');return false;">
208
+ <span class="method-name">sample</span><span class="method-args">(event)</span>
209
+ </a>
210
+ </div>
211
+
212
+ <div class="method-description">
213
+ </div>
214
+ </div>
215
+
216
+ <div id="method-M000055" class="method-detail">
217
+ <a name="M000055"></a>
218
+
219
+ <div class="method-heading">
220
+ <a href="StatsTracker.src/M000055.html" target="Code" class="method-signature"
221
+ onclick="popupCode('StatsTracker.src/M000055.html');return false;">
222
+ <span class="method-name">to_s</span><span class="method-args">()</span>
223
+ </a>
224
+ </div>
225
+
226
+ <div class="method-description">
227
+ </div>
228
+ </div>
229
+
230
+
231
+ </div>
232
+
233
+
234
+ </div>
235
+
236
+
237
+ <div id="validator-badges">
238
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
239
+ </div>
240
+
241
+ </body>
242
+ </html>