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,788 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>lib/rfuzz/stats.rb - C0 code coverage information</title>
5
+ <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
6
+ <style type='text/css'>span.cross-ref-title {
7
+ font-size: 140%;
8
+ }
9
+ span.cross-ref a {
10
+ text-decoration: none;
11
+ }
12
+ span.cross-ref {
13
+ background-color:#f3f7fa;
14
+ border: 1px dashed #333;
15
+ margin: 1em;
16
+ padding: 0.5em;
17
+ overflow: hidden;
18
+ }
19
+ a.crossref-toggle {
20
+ text-decoration: none;
21
+ }
22
+ span.marked0 {
23
+ background-color: rgb(185, 210, 200);
24
+ display: block;
25
+ }
26
+ span.marked1 {
27
+ background-color: rgb(190, 215, 205);
28
+ display: block;
29
+ }
30
+ span.inferred0 {
31
+ background-color: rgb(175, 200, 200);
32
+ display: block;
33
+ }
34
+ span.inferred1 {
35
+ background-color: rgb(180, 205, 205);
36
+ display: block;
37
+ }
38
+ span.uncovered0 {
39
+ background-color: rgb(225, 110, 110);
40
+ display: block;
41
+ }
42
+ span.uncovered1 {
43
+ background-color: rgb(235, 120, 120);
44
+ display: block;
45
+ }
46
+ span.overview {
47
+ border-bottom: 8px solid black;
48
+ }
49
+ div.overview {
50
+ border-bottom: 8px solid black;
51
+ }
52
+ body {
53
+ font-family: verdana, arial, helvetica;
54
+ }
55
+ div.footer {
56
+ font-size: 68%;
57
+ margin-top: 1.5em;
58
+ }
59
+ h1, h2, h3, h4, h5, h6 {
60
+ margin-bottom: 0.5em;
61
+ }
62
+ h5 {
63
+ margin-top: 0.5em;
64
+ }
65
+ .hidden {
66
+ display: none;
67
+ }
68
+ div.separator {
69
+ height: 10px;
70
+ }
71
+ /* Commented out for better readability, esp. on IE */
72
+ /*
73
+ table tr td, table tr th {
74
+ font-size: 68%;
75
+ }
76
+ td.value table tr td {
77
+ font-size: 11px;
78
+ }
79
+ */
80
+ table.percent_graph {
81
+ height: 12px;
82
+ border: #808080 1px solid;
83
+ empty-cells: show;
84
+ }
85
+ table.percent_graph td.covered {
86
+ height: 10px;
87
+ background: #00f000;
88
+ }
89
+ table.percent_graph td.uncovered {
90
+ height: 10px;
91
+ background: #e00000;
92
+ }
93
+ table.percent_graph td.NA {
94
+ height: 10px;
95
+ background: #eaeaea;
96
+ }
97
+ table.report {
98
+ border-collapse: collapse;
99
+ width: 100%;
100
+ }
101
+ table.report td.heading {
102
+ background: #dcecff;
103
+ border: #d0d0d0 1px solid;
104
+ font-weight: bold;
105
+ text-align: center;
106
+ }
107
+ table.report td.heading:hover {
108
+ background: #c0ffc0;
109
+ }
110
+ table.report td.text {
111
+ border: #d0d0d0 1px solid;
112
+ }
113
+ table.report td.value {
114
+ text-align: right;
115
+ border: #d0d0d0 1px solid;
116
+ }
117
+ table.report tr.light {
118
+ background-color: rgb(240, 240, 245);
119
+ }
120
+ table.report tr.dark {
121
+ background-color: rgb(230, 230, 235);
122
+ }
123
+ </style>
124
+ <script type='text/javascript'>
125
+ // <![CDATA[
126
+ function toggleCode( id ) {
127
+ if ( document.getElementById )
128
+ elem = document.getElementById( id );
129
+ else if ( document.all )
130
+ elem = eval( "document.all." + id );
131
+ else
132
+ return false;
133
+
134
+ elemStyle = elem.style;
135
+
136
+ if ( elemStyle.display != "block" ) {
137
+ elemStyle.display = "block"
138
+ } else {
139
+ elemStyle.display = "none"
140
+ }
141
+
142
+ return true;
143
+ }
144
+
145
+ // Make cross-references hidden by default
146
+ document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
147
+ // ]]>
148
+ </script>
149
+ <style type='text/css'>span.run0 {
150
+ background-color: rgb(178, 204, 255);
151
+ display: block;
152
+ }
153
+ span.run1 {
154
+ background-color: rgb(178, 206, 255);
155
+ display: block;
156
+ }
157
+ span.run2 {
158
+ background-color: rgb(178, 209, 255);
159
+ display: block;
160
+ }
161
+ span.run3 {
162
+ background-color: rgb(178, 211, 255);
163
+ display: block;
164
+ }
165
+ span.run4 {
166
+ background-color: rgb(178, 214, 255);
167
+ display: block;
168
+ }
169
+ span.run5 {
170
+ background-color: rgb(178, 218, 255);
171
+ display: block;
172
+ }
173
+ span.run6 {
174
+ background-color: rgb(178, 220, 255);
175
+ display: block;
176
+ }
177
+ span.run7 {
178
+ background-color: rgb(178, 223, 255);
179
+ display: block;
180
+ }
181
+ span.run8 {
182
+ background-color: rgb(178, 225, 255);
183
+ display: block;
184
+ }
185
+ span.run9 {
186
+ background-color: rgb(178, 228, 255);
187
+ display: block;
188
+ }
189
+ span.run10 {
190
+ background-color: rgb(178, 232, 255);
191
+ display: block;
192
+ }
193
+ span.run11 {
194
+ background-color: rgb(178, 234, 255);
195
+ display: block;
196
+ }
197
+ span.run12 {
198
+ background-color: rgb(178, 237, 255);
199
+ display: block;
200
+ }
201
+ span.run13 {
202
+ background-color: rgb(178, 239, 255);
203
+ display: block;
204
+ }
205
+ span.run14 {
206
+ background-color: rgb(178, 242, 255);
207
+ display: block;
208
+ }
209
+ span.run15 {
210
+ background-color: rgb(178, 246, 255);
211
+ display: block;
212
+ }
213
+ span.run16 {
214
+ background-color: rgb(178, 248, 255);
215
+ display: block;
216
+ }
217
+ span.run17 {
218
+ background-color: rgb(178, 251, 255);
219
+ display: block;
220
+ }
221
+ span.run18 {
222
+ background-color: rgb(178, 253, 255);
223
+ display: block;
224
+ }
225
+ span.run19 {
226
+ background-color: rgb(178, 255, 253);
227
+ display: block;
228
+ }
229
+ span.run20 {
230
+ background-color: rgb(178, 255, 249);
231
+ display: block;
232
+ }
233
+ span.run21 {
234
+ background-color: rgb(178, 255, 247);
235
+ display: block;
236
+ }
237
+ span.run22 {
238
+ background-color: rgb(178, 255, 244);
239
+ display: block;
240
+ }
241
+ span.run23 {
242
+ background-color: rgb(178, 255, 242);
243
+ display: block;
244
+ }
245
+ span.run24 {
246
+ background-color: rgb(178, 255, 239);
247
+ display: block;
248
+ }
249
+ span.run25 {
250
+ background-color: rgb(178, 255, 235);
251
+ display: block;
252
+ }
253
+ span.run26 {
254
+ background-color: rgb(178, 255, 233);
255
+ display: block;
256
+ }
257
+ span.run27 {
258
+ background-color: rgb(178, 255, 230);
259
+ display: block;
260
+ }
261
+ span.run28 {
262
+ background-color: rgb(178, 255, 228);
263
+ display: block;
264
+ }
265
+ span.run29 {
266
+ background-color: rgb(178, 255, 225);
267
+ display: block;
268
+ }
269
+ span.run30 {
270
+ background-color: rgb(178, 255, 221);
271
+ display: block;
272
+ }
273
+ span.run31 {
274
+ background-color: rgb(178, 255, 219);
275
+ display: block;
276
+ }
277
+ span.run32 {
278
+ background-color: rgb(178, 255, 216);
279
+ display: block;
280
+ }
281
+ span.run33 {
282
+ background-color: rgb(178, 255, 214);
283
+ display: block;
284
+ }
285
+ span.run34 {
286
+ background-color: rgb(178, 255, 211);
287
+ display: block;
288
+ }
289
+ span.run35 {
290
+ background-color: rgb(178, 255, 207);
291
+ display: block;
292
+ }
293
+ span.run36 {
294
+ background-color: rgb(178, 255, 205);
295
+ display: block;
296
+ }
297
+ span.run37 {
298
+ background-color: rgb(178, 255, 202);
299
+ display: block;
300
+ }
301
+ span.run38 {
302
+ background-color: rgb(178, 255, 200);
303
+ display: block;
304
+ }
305
+ span.run39 {
306
+ background-color: rgb(178, 255, 197);
307
+ display: block;
308
+ }
309
+ span.run40 {
310
+ background-color: rgb(178, 255, 193);
311
+ display: block;
312
+ }
313
+ span.run41 {
314
+ background-color: rgb(178, 255, 191);
315
+ display: block;
316
+ }
317
+ span.run42 {
318
+ background-color: rgb(178, 255, 188);
319
+ display: block;
320
+ }
321
+ span.run43 {
322
+ background-color: rgb(178, 255, 186);
323
+ display: block;
324
+ }
325
+ span.run44 {
326
+ background-color: rgb(178, 255, 183);
327
+ display: block;
328
+ }
329
+ span.run45 {
330
+ background-color: rgb(178, 255, 179);
331
+ display: block;
332
+ }
333
+ span.run46 {
334
+ background-color: rgb(179, 255, 178);
335
+ display: block;
336
+ }
337
+ span.run47 {
338
+ background-color: rgb(182, 255, 178);
339
+ display: block;
340
+ }
341
+ span.run48 {
342
+ background-color: rgb(184, 255, 178);
343
+ display: block;
344
+ }
345
+ span.run49 {
346
+ background-color: rgb(187, 255, 178);
347
+ display: block;
348
+ }
349
+ span.run50 {
350
+ background-color: rgb(191, 255, 178);
351
+ display: block;
352
+ }
353
+ span.run51 {
354
+ background-color: rgb(193, 255, 178);
355
+ display: block;
356
+ }
357
+ span.run52 {
358
+ background-color: rgb(196, 255, 178);
359
+ display: block;
360
+ }
361
+ span.run53 {
362
+ background-color: rgb(198, 255, 178);
363
+ display: block;
364
+ }
365
+ span.run54 {
366
+ background-color: rgb(201, 255, 178);
367
+ display: block;
368
+ }
369
+ span.run55 {
370
+ background-color: rgb(205, 255, 178);
371
+ display: block;
372
+ }
373
+ span.run56 {
374
+ background-color: rgb(207, 255, 178);
375
+ display: block;
376
+ }
377
+ span.run57 {
378
+ background-color: rgb(210, 255, 178);
379
+ display: block;
380
+ }
381
+ span.run58 {
382
+ background-color: rgb(212, 255, 178);
383
+ display: block;
384
+ }
385
+ span.run59 {
386
+ background-color: rgb(215, 255, 178);
387
+ display: block;
388
+ }
389
+ span.run60 {
390
+ background-color: rgb(219, 255, 178);
391
+ display: block;
392
+ }
393
+ span.run61 {
394
+ background-color: rgb(221, 255, 178);
395
+ display: block;
396
+ }
397
+ span.run62 {
398
+ background-color: rgb(224, 255, 178);
399
+ display: block;
400
+ }
401
+ span.run63 {
402
+ background-color: rgb(226, 255, 178);
403
+ display: block;
404
+ }
405
+ span.run64 {
406
+ background-color: rgb(229, 255, 178);
407
+ display: block;
408
+ }
409
+ span.run65 {
410
+ background-color: rgb(233, 255, 178);
411
+ display: block;
412
+ }
413
+ span.run66 {
414
+ background-color: rgb(235, 255, 178);
415
+ display: block;
416
+ }
417
+ span.run67 {
418
+ background-color: rgb(238, 255, 178);
419
+ display: block;
420
+ }
421
+ span.run68 {
422
+ background-color: rgb(240, 255, 178);
423
+ display: block;
424
+ }
425
+ span.run69 {
426
+ background-color: rgb(243, 255, 178);
427
+ display: block;
428
+ }
429
+ span.run70 {
430
+ background-color: rgb(247, 255, 178);
431
+ display: block;
432
+ }
433
+ span.run71 {
434
+ background-color: rgb(249, 255, 178);
435
+ display: block;
436
+ }
437
+ span.run72 {
438
+ background-color: rgb(252, 255, 178);
439
+ display: block;
440
+ }
441
+ span.run73 {
442
+ background-color: rgb(255, 255, 178);
443
+ display: block;
444
+ }
445
+ span.run74 {
446
+ background-color: rgb(255, 252, 178);
447
+ display: block;
448
+ }
449
+ span.run75 {
450
+ background-color: rgb(255, 248, 178);
451
+ display: block;
452
+ }
453
+ span.run76 {
454
+ background-color: rgb(255, 246, 178);
455
+ display: block;
456
+ }
457
+ span.run77 {
458
+ background-color: rgb(255, 243, 178);
459
+ display: block;
460
+ }
461
+ span.run78 {
462
+ background-color: rgb(255, 240, 178);
463
+ display: block;
464
+ }
465
+ span.run79 {
466
+ background-color: rgb(255, 238, 178);
467
+ display: block;
468
+ }
469
+ span.run80 {
470
+ background-color: rgb(255, 234, 178);
471
+ display: block;
472
+ }
473
+ span.run81 {
474
+ background-color: rgb(255, 232, 178);
475
+ display: block;
476
+ }
477
+ span.run82 {
478
+ background-color: rgb(255, 229, 178);
479
+ display: block;
480
+ }
481
+ span.run83 {
482
+ background-color: rgb(255, 226, 178);
483
+ display: block;
484
+ }
485
+ span.run84 {
486
+ background-color: rgb(255, 224, 178);
487
+ display: block;
488
+ }
489
+ span.run85 {
490
+ background-color: rgb(255, 220, 178);
491
+ display: block;
492
+ }
493
+ span.run86 {
494
+ background-color: rgb(255, 218, 178);
495
+ display: block;
496
+ }
497
+ span.run87 {
498
+ background-color: rgb(255, 215, 178);
499
+ display: block;
500
+ }
501
+ span.run88 {
502
+ background-color: rgb(255, 212, 178);
503
+ display: block;
504
+ }
505
+ span.run89 {
506
+ background-color: rgb(255, 210, 178);
507
+ display: block;
508
+ }
509
+ span.run90 {
510
+ background-color: rgb(255, 206, 178);
511
+ display: block;
512
+ }
513
+ span.run91 {
514
+ background-color: rgb(255, 204, 178);
515
+ display: block;
516
+ }
517
+ span.run92 {
518
+ background-color: rgb(255, 201, 178);
519
+ display: block;
520
+ }
521
+ span.run93 {
522
+ background-color: rgb(255, 198, 178);
523
+ display: block;
524
+ }
525
+ span.run94 {
526
+ background-color: rgb(255, 196, 178);
527
+ display: block;
528
+ }
529
+ span.run95 {
530
+ background-color: rgb(255, 192, 178);
531
+ display: block;
532
+ }
533
+ span.run96 {
534
+ background-color: rgb(255, 189, 178);
535
+ display: block;
536
+ }
537
+ span.run97 {
538
+ background-color: rgb(255, 187, 178);
539
+ display: block;
540
+ }
541
+ span.run98 {
542
+ background-color: rgb(255, 184, 178);
543
+ display: block;
544
+ }
545
+ span.run99 {
546
+ background-color: rgb(255, 182, 178);
547
+ display: block;
548
+ }
549
+ span.run100 {
550
+ background-color: rgb(255, 178, 178);
551
+ display: block;
552
+ }
553
+ </style>
554
+ </head>
555
+ <body>
556
+ <h3>C0 code coverage information</h3>
557
+ <p>Generated on Wed Jul 19 17:39:34 EDT 2006 with <a href='http://eigenclass.org/hiki.rb?rcov'>rcov 0.6.0</a>
558
+ </p>
559
+ <hr /><pre><span class='marked0'>Code reported as executed by Ruby looks like this...
560
+ </span><span class='marked1'>and this: this line is also marked as covered.
561
+ </span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this,
562
+ </span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).
563
+ </span><span class='uncovered0'>Finally, here&apos;s a line marked as not executed.
564
+ </span></pre>
565
+ <table class='report'>
566
+ <thead>
567
+ <tr>
568
+ <td class='heading'>Name</td>
569
+ <td class='heading'>Total lines</td>
570
+ <td class='heading'>Lines of code</td>
571
+ <td class='heading'>Total coverage</td>
572
+ <td class='heading'>Code coverage</td>
573
+ </tr>
574
+ </thead>
575
+ <tbody>
576
+ <tr class='light'>
577
+ <td>
578
+ <a href='lib-rfuzz-stats_rb.html'>lib/rfuzz/stats.rb</a>
579
+ </td>
580
+ <td class='value'>
581
+ <tt>159</tt>
582
+ </td>
583
+ <td class='value'>
584
+ <tt>95</tt>
585
+ </td>
586
+ <td>
587
+ <table cellspacing='0' cellpadding='0' align='right'>
588
+ <tr>
589
+ <td>
590
+ <tt>92.5%</tt>&nbsp;</td>
591
+ <td>
592
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
593
+ <tr>
594
+ <td class='covered' width='92' />
595
+ <td class='uncovered' width='8' />
596
+ </tr>
597
+ </table>
598
+ </td>
599
+ </tr>
600
+ </table>
601
+ </td>
602
+ <td>
603
+ <table cellspacing='0' cellpadding='0' align='right'>
604
+ <tr>
605
+ <td>
606
+ <tt>87.4%</tt>&nbsp;</td>
607
+ <td>
608
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
609
+ <tr>
610
+ <td class='covered' width='87' />
611
+ <td class='uncovered' width='13' />
612
+ </tr>
613
+ </table>
614
+ </td>
615
+ </tr>
616
+ </table>
617
+ </td>
618
+ </tr>
619
+ </tbody>
620
+ </table><pre><span class="inferred1"><a name="line1" /> 1 # Copyright (c) 2005 Zed A. Shaw
621
+ </span><span class="inferred0"><a name="line2" /> 2 # You can redistribute it and/or modify it under the same terms as Ruby.
622
+ </span><span class="inferred1"><a name="line3" /> 3 #
623
+ </span><span class="inferred0"><a name="line4" /> 4 # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
624
+ </span><span class="inferred1"><a name="line5" /> 5 # for more information.
625
+ </span><span class="inferred0"><a name="line6" /> 6
626
+ </span><span class="inferred1"><a name="line7" /> 7 # A very simple little class for doing some basic fast statistics sampling.
627
+ </span><span class="inferred0"><a name="line8" /> 8 # You feed it either samples of numeric data you want measured or you call
628
+ </span><span class="inferred1"><a name="line9" /> 9 # Sampler.tick to get it to add a time delta between the last time you called it.
629
+ </span><span class="inferred0"><a name="line10" /> 10 # When you're done either call sum, sumsq, n, min, max, mean or sd to get
630
+ </span><span class="inferred1"><a name="line11" /> 11 # the information. The other option is to just call dump and see everything.
631
+ </span><span class="inferred0"><a name="line12" /> 12 #
632
+ </span><span class="inferred1"><a name="line13" /> 13 # It does all of this very fast and doesn't take up any memory since the samples
633
+ </span><span class="inferred0"><a name="line14" /> 14 # are not stored but instead all the values are calculated on the fly.
634
+ </span><span class="marked1"><a name="line15" /> 15 module RFuzz
635
+ </span><span class="marked0"><a name="line16" /> 16 class Sampler
636
+ </span><span class="marked1"><a name="line17" /> 17 attr_reader :sum, :sumsq, :n, :min, :max
637
+ </span><span class="inferred0"><a name="line18" /> 18
638
+ </span><span class="marked1"><a name="line19" /> 19 def initialize(name)
639
+ </span><span class="marked0"><a name="line20" /> 20 @name = name
640
+ </span><span class="marked1"><a name="line21" /> 21 reset
641
+ </span><span class="marked0"><a name="line22" /> 22 end
642
+ </span><span class="inferred1"><a name="line23" /> 23
643
+ </span><span class="inferred0"><a name="line24" /> 24 # Resets the internal counters so you can start sampling again.
644
+ </span><span class="marked1"><a name="line25" /> 25 def reset
645
+ </span><span class="marked0"><a name="line26" /> 26 @sum = 0.0
646
+ </span><span class="marked1"><a name="line27" /> 27 @sumsq = 0.0
647
+ </span><span class="marked0"><a name="line28" /> 28 @last_time = Time.new
648
+ </span><span class="marked1"><a name="line29" /> 29 @n = 0.0
649
+ </span><span class="marked0"><a name="line30" /> 30 @min = 0.0
650
+ </span><span class="marked1"><a name="line31" /> 31 @max = 0.0
651
+ </span><span class="inferred0"><a name="line32" /> 32 end
652
+ </span><span class="inferred1"><a name="line33" /> 33
653
+ </span><span class="inferred0"><a name="line34" /> 34 # Adds a sampling to the calculations.
654
+ </span><span class="marked1"><a name="line35" /> 35 def sample(s)
655
+ </span><span class="marked0"><a name="line36" /> 36 @sum += s
656
+ </span><span class="marked1"><a name="line37" /> 37 @sumsq += s * s
657
+ </span><span class="marked0"><a name="line38" /> 38 if @n == 0
658
+ </span><span class="marked1"><a name="line39" /> 39 @min = @max = s
659
+ </span><span class="inferred0"><a name="line40" /> 40 else
660
+ </span><span class="marked1"><a name="line41" /> 41 @min = s if @min &gt; s
661
+ </span><span class="marked0"><a name="line42" /> 42 @max = s if @max &lt; s
662
+ </span><span class="inferred1"><a name="line43" /> 43 end
663
+ </span><span class="marked0"><a name="line44" /> 44 @n+=1
664
+ </span><span class="inferred1"><a name="line45" /> 45 end
665
+ </span><span class="inferred0"><a name="line46" /> 46
666
+ </span><span class="inferred1"><a name="line47" /> 47 # Dump this Sampler object with an optional additional message.
667
+ </span><span class="marked0"><a name="line48" /> 48 def dump(msg = &quot;&quot;, out=STDERR)
668
+ </span><span class="marked1"><a name="line49" /> 49 out.puts &quot;#{msg}: #{self.to_s}&quot;
669
+ </span><span class="marked0"><a name="line50" /> 50 end
670
+ </span><span class="inferred1"><a name="line51" /> 51
671
+ </span><span class="inferred0"><a name="line52" /> 52 # Returns a common display (used by dump)
672
+ </span><span class="marked1"><a name="line53" /> 53 def to_s
673
+ </span><span class="marked0"><a name="line54" /> 54 &quot;[%s]: SUM=%0.6f, SUMSQ=%0.6f, N=%0.6f, MEAN=%0.6f, SD=%0.6f, MIN=%0.6f, MAX=%0.6f&quot; % values
674
+ </span><span class="marked1"><a name="line55" /> 55 end
675
+ </span><span class="inferred0"><a name="line56" /> 56
676
+ </span><span class="inferred1"><a name="line57" /> 57 # An array of the values minus the name: [sum,sumsq,n,mean,sd,min,max]
677
+ </span><span class="marked0"><a name="line58" /> 58 def values
678
+ </span><span class="marked1"><a name="line59" /> 59 [@name, @sum, @sumsq, @n, mean, sd, @min, @max]
679
+ </span><span class="marked0"><a name="line60" /> 60 end
680
+ </span><span class="inferred1"><a name="line61" /> 61
681
+ </span><span class="inferred0"><a name="line62" /> 62 # Class method that returns the headers that a CSV file would have for the
682
+ </span><span class="inferred1"><a name="line63" /> 63 # values that this stats object is using.
683
+ </span><span class="marked0"><a name="line64" /> 64 def self.keys
684
+ </span><span class="marked1"><a name="line65" /> 65 [&quot;name&quot;,&quot;sum&quot;,&quot;sumsq&quot;,&quot;n&quot;,&quot;mean&quot;,&quot;sd&quot;,&quot;min&quot;,&quot;max&quot;]
685
+ </span><span class="marked0"><a name="line66" /> 66 end
686
+ </span><span class="inferred1"><a name="line67" /> 67
687
+ </span><span class="marked0"><a name="line68" /> 68 def to_hash
688
+ </span><span class="uncovered1"><a name="line69" /> 69 {&quot;name&quot; =&gt; @name, &quot;sum&quot; =&gt; @sum, &quot;sumsq&quot; =&gt; @sumsq, &quot;mean&quot; =&gt; mean,
689
+ </span><span class="uncovered0"><a name="line70" /> 70 &quot;sd&quot; =&gt; sd, &quot;min&quot; =&gt; @min, &quot;max&quot; =&gt; @max}
690
+ </span><span class="uncovered1"><a name="line71" /> 71 end
691
+ </span><span class="inferred0"><a name="line72" /> 72
692
+ </span><span class="inferred1"><a name="line73" /> 73 # Calculates and returns the mean for the data passed so far.
693
+ </span><span class="marked0"><a name="line74" /> 74 def mean
694
+ </span><span class="marked1"><a name="line75" /> 75 @sum / @n
695
+ </span><span class="marked0"><a name="line76" /> 76 end
696
+ </span><span class="inferred1"><a name="line77" /> 77
697
+ </span><span class="inferred0"><a name="line78" /> 78 # Calculates the standard deviation of the data so far.
698
+ </span><span class="marked1"><a name="line79" /> 79 def sd
699
+ </span><span class="inferred0"><a name="line80" /> 80 # (sqrt( ((s).sumsq - ( (s).sum * (s).sum / (s).n)) / ((s).n-1) ))
700
+ </span><span class="marked1"><a name="line81" /> 81 begin
701
+ </span><span class="marked0"><a name="line82" /> 82 return Math.sqrt( (@sumsq - ( @sum * @sum / @n)) / (@n-1) )
702
+ </span><span class="uncovered1"><a name="line83" /> 83 rescue Errno::EDOM
703
+ </span><span class="uncovered0"><a name="line84" /> 84 return 0.0
704
+ </span><span class="uncovered1"><a name="line85" /> 85 end
705
+ </span><span class="marked0"><a name="line86" /> 86 end
706
+ </span><span class="inferred1"><a name="line87" /> 87
707
+ </span><span class="inferred0"><a name="line88" /> 88 # You can just call tick repeatedly if you need the delta times
708
+ </span><span class="inferred1"><a name="line89" /> 89 # between a set of sample periods, but many times you actually want
709
+ </span><span class="inferred0"><a name="line90" /> 90 # to sample how long something takes between a start/end period.
710
+ </span><span class="inferred1"><a name="line91" /> 91 # Call mark at the beginning and then tick at the end you'll get this
711
+ </span><span class="inferred0"><a name="line92" /> 92 # kind of measurement. Don't mix mark/tick and tick sampling together
712
+ </span><span class="inferred1"><a name="line93" /> 93 # or the measurement will be meaningless.
713
+ </span><span class="marked0"><a name="line94" /> 94 def mark
714
+ </span><span class="marked1"><a name="line95" /> 95 @last_time = Time.now
715
+ </span><span class="marked0"><a name="line96" /> 96 end
716
+ </span><span class="inferred1"><a name="line97" /> 97
717
+ </span><span class="inferred0"><a name="line98" /> 98 # Adds a time delta between now and the last time you called this. This
718
+ </span><span class="inferred1"><a name="line99" /> 99 # will give you the average time between two activities.
719
+ </span><span class="inferred0"><a name="line100" />100 #
720
+ </span><span class="inferred1"><a name="line101" />101 # An example is:
721
+ </span><span class="inferred0"><a name="line102" />102 #
722
+ </span><span class="inferred1"><a name="line103" />103 # t = Sampler.new(&quot;do_stuff&quot;)
723
+ </span><span class="inferred0"><a name="line104" />104 # 10000.times { do_stuff(); t.tick }
724
+ </span><span class="inferred1"><a name="line105" />105 # t.dump(&quot;time&quot;)
725
+ </span><span class="inferred0"><a name="line106" />106 #
726
+ </span><span class="marked1"><a name="line107" />107 def tick
727
+ </span><span class="marked0"><a name="line108" />108 now = Time.now
728
+ </span><span class="marked1"><a name="line109" />109 sample(now - @last_time)
729
+ </span><span class="marked0"><a name="line110" />110 @last_time = now
730
+ </span><span class="inferred1"><a name="line111" />111 end
731
+ </span><span class="inferred0"><a name="line112" />112 end
732
+ </span><span class="inferred1"><a name="line113" />113
733
+ </span><span class="inferred0"><a name="line114" />114 # When registered as the notifier for a client it tracks
734
+ </span><span class="inferred1"><a name="line115" />115 # the times for each part of the request. Rather than subclassing
735
+ </span><span class="inferred0"><a name="line116" />116 # RFuzz::Notifier it uses a method_missing to record the even timings.
736
+ </span><span class="inferred1"><a name="line117" />117 #
737
+ </span><span class="inferred0"><a name="line118" />118 # You can dump it with to_s, or you can access the StatsTracker.stats
738
+ </span><span class="inferred1"><a name="line119" />119 # hash to read the RFuzz::Sampler objects related to each event.
739
+ </span><span class="marked0"><a name="line120" />120 class StatsTracker
740
+ </span><span class="marked1"><a name="line121" />121 attr_reader :stats
741
+ </span><span class="inferred0"><a name="line122" />122
742
+ </span><span class="marked1"><a name="line123" />123 def initialize
743
+ </span><span class="marked0"><a name="line124" />124 @stats = {}
744
+ </span><span class="marked1"><a name="line125" />125 @error_count = 0
745
+ </span><span class="inferred0"><a name="line126" />126 end
746
+ </span><span class="inferred1"><a name="line127" />127
747
+ </span><span class="marked0"><a name="line128" />128 def mark(event)
748
+ </span><span class="marked1"><a name="line129" />129 @stats[event] ||= RFuzz::Sampler.new(event)
749
+ </span><span class="marked0"><a name="line130" />130 @stats[event].mark
750
+ </span><span class="marked1"><a name="line131" />131 end
751
+ </span><span class="inferred0"><a name="line132" />132
752
+ </span><span class="marked1"><a name="line133" />133 def sample(event)
753
+ </span><span class="marked0"><a name="line134" />134 @stats[event].tick
754
+ </span><span class="marked1"><a name="line135" />135 end
755
+ </span><span class="inferred0"><a name="line136" />136
756
+ </span><span class="marked1"><a name="line137" />137 def reset
757
+ </span><span class="marked0"><a name="line138" />138 @stats.each {|e,s| s.reset }
758
+ </span><span class="marked1"><a name="line139" />139 end
759
+ </span><span class="inferred0"><a name="line140" />140
760
+ </span><span class="marked1"><a name="line141" />141 def method_missing(event, *args)
761
+ </span><span class="marked0"><a name="line142" />142 case args[0]
762
+ </span><span class="marked1"><a name="line143" />143 when :begins
763
+ </span><span class="marked0"><a name="line144" />144 mark(:request) if event == :connect
764
+ </span><span class="marked1"><a name="line145" />145 mark(event)
765
+ </span><span class="marked0"><a name="line146" />146 when :ends
766
+ </span><span class="marked1"><a name="line147" />147 sample(:request) if event == :close
767
+ </span><span class="marked0"><a name="line148" />148 sample(event)
768
+ </span><span class="marked1"><a name="line149" />149 when :error
769
+ </span><span class="inferred0"><a name="line150" />150 sample(:request)
770
+ </span><span class="uncovered1"><a name="line151" />151 @error_count += 1
771
+ </span><span class="uncovered0"><a name="line152" />152 end
772
+ </span><span class="marked1"><a name="line153" />153 end
773
+ </span><span class="inferred0"><a name="line154" />154
774
+ </span><span class="marked1"><a name="line155" />155 def to_s
775
+ </span><span class="uncovered0"><a name="line156" />156 &quot;#{@stats.values.join(&quot;\n&quot;)}\nErrors: #@error_count&quot;
776
+ </span><span class="uncovered1"><a name="line157" />157 end
777
+ </span><span class="uncovered0"><a name="line158" />158 end
778
+ </span><span class="uncovered1"><a name="line159" />159 end
779
+ </span></pre><hr /> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.6.0.</p><p>
780
+ <a href='http://validator.w3.org/check/referer'>
781
+ <img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88' />
782
+ </a>
783
+ <a href='http://jigsaw.w3.org/css-validator/check/referer'>
784
+ <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
785
+ </a>
786
+ </p>
787
+ </body>
788
+ </html>