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,21 @@
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::RandomGenerator)</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/random.rb, line 16</span>
14
+ 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">dict</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">type</span>=<span class="ruby-identifier">:words</span>)
15
+ 17: <span class="ruby-comment cmt"># NOT meant to be secure so chill</span>
16
+ 18: <span class="ruby-ivar">@rnd</span> = <span class="ruby-constant">FuzzRnd</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{self.inspect}&quot;</span>)
17
+ 19: <span class="ruby-ivar">@dict</span> = <span class="ruby-identifier">dict</span>
18
+ 20: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
19
+ 21: <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </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>hash_of (RFuzz::RandomGenerator)</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/random.rb, line 31</span>
14
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_of</span>(<span class="ruby-identifier">count</span>,<span class="ruby-identifier">length</span>=<span class="ruby-value">5</span>,<span class="ruby-identifier">type</span>=<span class="ruby-ivar">@type</span>)
15
+ 32: <span class="ruby-identifier">list</span> = []
16
+ 33: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
17
+ 34: <span class="ruby-identifier">list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Hash</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span>,<span class="ruby-identifier">length</span><span class="ruby-operator">*</span><span class="ruby-value">2</span>)]
18
+ 35: <span class="ruby-keyword kw">end</span>
19
+ 36:
20
+ 37: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>
21
+ 38: <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,22 @@
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>uris (RFuzz::RandomGenerator)</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/random.rb, line 45</span>
14
+ 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uris</span>(<span class="ruby-identifier">count</span>,<span class="ruby-identifier">length</span>=<span class="ruby-value">100</span>)
15
+ 46: <span class="ruby-identifier">ulist</span> = []
16
+ 47: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
17
+ 48: <span class="ruby-identifier">ulist</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">words</span>(<span class="ruby-identifier">num</span>(<span class="ruby-identifier">length</span>)).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/&quot;</span>).<span class="ruby-identifier">tr</span>(<span class="ruby-value str">&quot;'&quot;</span>,<span class="ruby-value str">&quot;&quot;</span>)
18
+ 49: <span class="ruby-keyword kw">end</span>
19
+ 50: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ulist</span>
20
+ 51: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,20 @@
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>words (RFuzz::RandomGenerator)</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/random.rb, line 55</span>
14
+ 55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">words</span>(<span class="ruby-identifier">count</span>=<span class="ruby-value">1</span>)
15
+ 56: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;You need a dictionary.&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@dict</span>
16
+ 57: <span class="ruby-identifier">w</span> = <span class="ruby-identifier">ints</span>(<span class="ruby-identifier">count</span>, <span class="ruby-ivar">@dict</span>.<span class="ruby-identifier">length</span>)
17
+ 58: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@dict</span>[<span class="ruby-identifier">i</span>]}
18
+ 59: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,22 @@
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>base64 (RFuzz::RandomGenerator)</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/random.rb, line 65</span>
14
+ 65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64</span>(<span class="ruby-identifier">count</span>,<span class="ruby-identifier">length</span>=<span class="ruby-value">100</span>)
15
+ 66: <span class="ruby-identifier">list</span> = []
16
+ 67: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> {
17
+ 68: <span class="ruby-identifier">list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">num</span>(<span class="ruby-identifier">length</span>)))
18
+ 69: }
19
+ 70: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>
20
+ 71: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,20 @@
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>byte_array (RFuzz::RandomGenerator)</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/random.rb, line 76</span>
14
+ 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">byte_array</span>(<span class="ruby-identifier">count</span>,<span class="ruby-identifier">length</span>=<span class="ruby-value">100</span>)
15
+ 77: <span class="ruby-identifier">list</span> = []
16
+ 78: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> { <span class="ruby-identifier">list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">num</span>(<span class="ruby-identifier">length</span>)) }
17
+ 79: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>
18
+ 80: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </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>bytes (RFuzz::RandomGenerator)</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/random.rb, line 83</span>
14
+ 83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bytes</span>(<span class="ruby-identifier">count</span>)
15
+ 84: <span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">count</span>)
16
+ 85: <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>num (RFuzz::RandomGenerator)</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/random.rb, line 88</span>
14
+ 88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">num</span>(<span class="ruby-identifier">max</span>)
15
+ 89: <span class="ruby-identifier">ints</span>(<span class="ruby-value">1</span>, <span class="ruby-identifier">max</span>)[<span class="ruby-value">0</span>]
16
+ 90: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,22 @@
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>ints (RFuzz::RandomGenerator)</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/random.rb, line 96</span>
14
+ 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ints</span>(<span class="ruby-identifier">count</span>, <span class="ruby-identifier">max</span> = <span class="ruby-keyword kw">nil</span>)
15
+ 97: <span class="ruby-identifier">i</span> = <span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">count</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;N*&quot;</span>)
16
+ 98: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">max</span>
17
+ 99: <span class="ruby-identifier">i</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">max</span> }
18
+ 100: <span class="ruby-keyword kw">end</span>
19
+ 101: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">i</span>
20
+ 102: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </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>floats (RFuzz::RandomGenerator)</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/random.rb, line 105</span>
14
+ 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">floats</span>(<span class="ruby-identifier">count</span>)
15
+ 106: <span class="ruby-ivar">@rnd</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">count</span> <span class="ruby-operator">*</span> <span class="ruby-value">8</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;G*&quot;</span>)
16
+ 107: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,383 @@
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::Sampler</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::Sampler</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
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000059">dump</a>&nbsp;&nbsp;
90
+ <a href="#M000062">keys</a>&nbsp;&nbsp;
91
+ <a href="#M000066">mark</a>&nbsp;&nbsp;
92
+ <a href="#M000064">mean</a>&nbsp;&nbsp;
93
+ <a href="#M000056">new</a>&nbsp;&nbsp;
94
+ <a href="#M000057">reset</a>&nbsp;&nbsp;
95
+ <a href="#M000058">sample</a>&nbsp;&nbsp;
96
+ <a href="#M000065">sd</a>&nbsp;&nbsp;
97
+ <a href="#M000067">tick</a>&nbsp;&nbsp;
98
+ <a href="#M000063">to_hash</a>&nbsp;&nbsp;
99
+ <a href="#M000060">to_s</a>&nbsp;&nbsp;
100
+ <a href="#M000061">values</a>&nbsp;&nbsp;
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+
106
+
107
+ <!-- if includes -->
108
+
109
+ <div id="section">
110
+
111
+
112
+
113
+
114
+
115
+ <div id="attribute-list">
116
+ <h3 class="section-bar">Attributes</h3>
117
+
118
+ <div class="name-list">
119
+ <table>
120
+ <tr class="top-aligned-row context-row">
121
+ <td class="context-item-name">max</td>
122
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
123
+ <td class="context-item-desc"></td>
124
+ </tr>
125
+ <tr class="top-aligned-row context-row">
126
+ <td class="context-item-name">min</td>
127
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
128
+ <td class="context-item-desc"></td>
129
+ </tr>
130
+ <tr class="top-aligned-row context-row">
131
+ <td class="context-item-name">n</td>
132
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
133
+ <td class="context-item-desc"></td>
134
+ </tr>
135
+ <tr class="top-aligned-row context-row">
136
+ <td class="context-item-name">sum</td>
137
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
138
+ <td class="context-item-desc"></td>
139
+ </tr>
140
+ <tr class="top-aligned-row context-row">
141
+ <td class="context-item-name">sumsq</td>
142
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143
+ <td class="context-item-desc"></td>
144
+ </tr>
145
+ </table>
146
+ </div>
147
+ </div>
148
+
149
+
150
+
151
+ <!-- if method_list -->
152
+ <div id="methods">
153
+ <h3 class="section-bar">Public Class methods</h3>
154
+
155
+ <div id="method-M000062" class="method-detail">
156
+ <a name="M000062"></a>
157
+
158
+ <div class="method-heading">
159
+ <a href="Sampler.src/M000062.html" target="Code" class="method-signature"
160
+ onclick="popupCode('Sampler.src/M000062.html');return false;">
161
+ <span class="method-name">keys</span><span class="method-args">()</span>
162
+ </a>
163
+ </div>
164
+
165
+ <div class="method-description">
166
+ <p>
167
+ Class method that returns the headers that a CSV file would have for the
168
+ values that this stats object is using.
169
+ </p>
170
+ </div>
171
+ </div>
172
+
173
+ <div id="method-M000056" class="method-detail">
174
+ <a name="M000056"></a>
175
+
176
+ <div class="method-heading">
177
+ <a href="Sampler.src/M000056.html" target="Code" class="method-signature"
178
+ onclick="popupCode('Sampler.src/M000056.html');return false;">
179
+ <span class="method-name">new</span><span class="method-args">(name)</span>
180
+ </a>
181
+ </div>
182
+
183
+ <div class="method-description">
184
+ </div>
185
+ </div>
186
+
187
+ <h3 class="section-bar">Public Instance methods</h3>
188
+
189
+ <div id="method-M000059" class="method-detail">
190
+ <a name="M000059"></a>
191
+
192
+ <div class="method-heading">
193
+ <a href="Sampler.src/M000059.html" target="Code" class="method-signature"
194
+ onclick="popupCode('Sampler.src/M000059.html');return false;">
195
+ <span class="method-name">dump</span><span class="method-args">(msg = &quot;&quot;, out=STDERR)</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ <p>
201
+ Dump this <a href="Sampler.html">Sampler</a> object with an optional
202
+ additional message.
203
+ </p>
204
+ </div>
205
+ </div>
206
+
207
+ <div id="method-M000066" class="method-detail">
208
+ <a name="M000066"></a>
209
+
210
+ <div class="method-heading">
211
+ <a href="Sampler.src/M000066.html" target="Code" class="method-signature"
212
+ onclick="popupCode('Sampler.src/M000066.html');return false;">
213
+ <span class="method-name">mark</span><span class="method-args">()</span>
214
+ </a>
215
+ </div>
216
+
217
+ <div class="method-description">
218
+ <p>
219
+ You can just call tick repeatedly if you need the delta times between a set
220
+ of sample periods, but many times you actually want to sample how long
221
+ something takes between a start/end period. Call mark at the beginning and
222
+ then tick at the end you&#8217;ll get this kind of measurement. Don&#8216;t
223
+ mix mark/tick and tick sampling together or the measurement will be
224
+ meaningless.
225
+ </p>
226
+ </div>
227
+ </div>
228
+
229
+ <div id="method-M000064" class="method-detail">
230
+ <a name="M000064"></a>
231
+
232
+ <div class="method-heading">
233
+ <a href="Sampler.src/M000064.html" target="Code" class="method-signature"
234
+ onclick="popupCode('Sampler.src/M000064.html');return false;">
235
+ <span class="method-name">mean</span><span class="method-args">()</span>
236
+ </a>
237
+ </div>
238
+
239
+ <div class="method-description">
240
+ <p>
241
+ Calculates and returns the mean for the data passed so far.
242
+ </p>
243
+ </div>
244
+ </div>
245
+
246
+ <div id="method-M000057" class="method-detail">
247
+ <a name="M000057"></a>
248
+
249
+ <div class="method-heading">
250
+ <a href="Sampler.src/M000057.html" target="Code" class="method-signature"
251
+ onclick="popupCode('Sampler.src/M000057.html');return false;">
252
+ <span class="method-name">reset</span><span class="method-args">()</span>
253
+ </a>
254
+ </div>
255
+
256
+ <div class="method-description">
257
+ <p>
258
+ Resets the internal counters so you can start sampling again.
259
+ </p>
260
+ </div>
261
+ </div>
262
+
263
+ <div id="method-M000058" class="method-detail">
264
+ <a name="M000058"></a>
265
+
266
+ <div class="method-heading">
267
+ <a href="Sampler.src/M000058.html" target="Code" class="method-signature"
268
+ onclick="popupCode('Sampler.src/M000058.html');return false;">
269
+ <span class="method-name">sample</span><span class="method-args">(s)</span>
270
+ </a>
271
+ </div>
272
+
273
+ <div class="method-description">
274
+ <p>
275
+ Adds a sampling to the calculations.
276
+ </p>
277
+ </div>
278
+ </div>
279
+
280
+ <div id="method-M000065" class="method-detail">
281
+ <a name="M000065"></a>
282
+
283
+ <div class="method-heading">
284
+ <a href="Sampler.src/M000065.html" target="Code" class="method-signature"
285
+ onclick="popupCode('Sampler.src/M000065.html');return false;">
286
+ <span class="method-name">sd</span><span class="method-args">()</span>
287
+ </a>
288
+ </div>
289
+
290
+ <div class="method-description">
291
+ <p>
292
+ Calculates the standard deviation of the data so far.
293
+ </p>
294
+ </div>
295
+ </div>
296
+
297
+ <div id="method-M000067" class="method-detail">
298
+ <a name="M000067"></a>
299
+
300
+ <div class="method-heading">
301
+ <a href="Sampler.src/M000067.html" target="Code" class="method-signature"
302
+ onclick="popupCode('Sampler.src/M000067.html');return false;">
303
+ <span class="method-name">tick</span><span class="method-args">()</span>
304
+ </a>
305
+ </div>
306
+
307
+ <div class="method-description">
308
+ <p>
309
+ Adds a time delta between now and the last time you called this. This will
310
+ give you the average time between two activities.
311
+ </p>
312
+ <p>
313
+ An example is:
314
+ </p>
315
+ <pre>
316
+ t = Sampler.new(&quot;do_stuff&quot;)
317
+ 10000.times { do_stuff(); t.tick }
318
+ t.dump(&quot;time&quot;)
319
+ </pre>
320
+ </div>
321
+ </div>
322
+
323
+ <div id="method-M000063" class="method-detail">
324
+ <a name="M000063"></a>
325
+
326
+ <div class="method-heading">
327
+ <a href="Sampler.src/M000063.html" target="Code" class="method-signature"
328
+ onclick="popupCode('Sampler.src/M000063.html');return false;">
329
+ <span class="method-name">to_hash</span><span class="method-args">()</span>
330
+ </a>
331
+ </div>
332
+
333
+ <div class="method-description">
334
+ </div>
335
+ </div>
336
+
337
+ <div id="method-M000060" class="method-detail">
338
+ <a name="M000060"></a>
339
+
340
+ <div class="method-heading">
341
+ <a href="Sampler.src/M000060.html" target="Code" class="method-signature"
342
+ onclick="popupCode('Sampler.src/M000060.html');return false;">
343
+ <span class="method-name">to_s</span><span class="method-args">()</span>
344
+ </a>
345
+ </div>
346
+
347
+ <div class="method-description">
348
+ <p>
349
+ Returns a common display (used by dump)
350
+ </p>
351
+ </div>
352
+ </div>
353
+
354
+ <div id="method-M000061" class="method-detail">
355
+ <a name="M000061"></a>
356
+
357
+ <div class="method-heading">
358
+ <a href="Sampler.src/M000061.html" target="Code" class="method-signature"
359
+ onclick="popupCode('Sampler.src/M000061.html');return false;">
360
+ <span class="method-name">values</span><span class="method-args">()</span>
361
+ </a>
362
+ </div>
363
+
364
+ <div class="method-description">
365
+ <p>
366
+ An array of the values minus the name: [sum,sumsq,n,mean,sd,min,max]
367
+ </p>
368
+ </div>
369
+ </div>
370
+
371
+
372
+ </div>
373
+
374
+
375
+ </div>
376
+
377
+
378
+ <div id="validator-badges">
379
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
380
+ </div>
381
+
382
+ </body>
383
+ </html>