wee 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/INSTALL +7 -0
- data/README +268 -0
- data/Rakefile +26 -0
- data/TODO +116 -0
- data/benchmark/Centrino1300/result.2000.counter.action +45 -0
- data/benchmark/Centrino1300/result.2000.counter.render +43 -0
- data/benchmark/Centrino1300/result.2000.filehandler +43 -0
- data/benchmark/Centrino600/result.2000.counter.action +47 -0
- data/benchmark/Centrino600/result.2000.counter.render +45 -0
- data/benchmark/Centrino600/result.2000.filehandler +43 -0
- data/benchmark/Makefile +48 -0
- data/benchmark/bench.sh +24 -0
- data/benchmark/counter.rb +96 -0
- data/benchmark/filehandler.rb +6 -0
- data/doc/rdoc/classes/Array.html +172 -0
- data/doc/rdoc/classes/Cache.html +126 -0
- data/doc/rdoc/classes/Cache/StorageCache.html +320 -0
- data/doc/rdoc/classes/Cache/Strategy.html +128 -0
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +269 -0
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +238 -0
- data/doc/rdoc/classes/Cache/Strategy/LFU/Item.html +111 -0
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +238 -0
- data/doc/rdoc/classes/Cache/Strategy/LRU/Item.html +111 -0
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +225 -0
- data/doc/rdoc/classes/Cache/Strategy/Unbounded/Item.html +111 -0
- data/doc/rdoc/classes/Enumerable.html +146 -0
- data/doc/rdoc/classes/LiteralMethod.html +196 -0
- data/doc/rdoc/classes/Object.html +178 -0
- data/doc/rdoc/classes/String.html +172 -0
- data/doc/rdoc/classes/Struct.html +174 -0
- data/doc/rdoc/classes/Wee.html +160 -0
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +182 -0
- data/doc/rdoc/classes/Wee/Application.html +337 -0
- data/doc/rdoc/classes/Wee/Brush.html +245 -0
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +149 -0
- data/doc/rdoc/classes/Wee/Brush/ActionMixin.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +157 -0
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +210 -0
- data/doc/rdoc/classes/Wee/Brush/AssignMixin.html +141 -0
- data/doc/rdoc/classes/Wee/Brush/CallbackMixin.html +141 -0
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +225 -0
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +176 -0
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +283 -0
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +176 -0
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +195 -0
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +149 -0
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +172 -0
- data/doc/rdoc/classes/Wee/Brush/Page.html +193 -0
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +267 -0
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +177 -0
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +154 -0
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +173 -0
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +277 -0
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +229 -0
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +154 -0
- data/doc/rdoc/classes/Wee/Callback.html +231 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +308 -0
- data/doc/rdoc/classes/Wee/CallbackStream.html +227 -0
- data/doc/rdoc/classes/Wee/Canvas.html +235 -0
- data/doc/rdoc/classes/Wee/Component.html +933 -0
- data/doc/rdoc/classes/Wee/Context.html +111 -0
- data/doc/rdoc/classes/Wee/Decoration.html +338 -0
- data/doc/rdoc/classes/Wee/Delegate.html +247 -0
- data/doc/rdoc/classes/Wee/ErrorPage.html +175 -0
- data/doc/rdoc/classes/Wee/ErrorResponse.html +180 -0
- data/doc/rdoc/classes/Wee/GenericResponse.html +162 -0
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +751 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +351 -0
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +180 -0
- data/doc/rdoc/classes/Wee/MethodCallback.html +193 -0
- data/doc/rdoc/classes/Wee/Page.html +111 -0
- data/doc/rdoc/classes/Wee/Presenter.html +521 -0
- data/doc/rdoc/classes/Wee/RedirectResponse.html +150 -0
- data/doc/rdoc/classes/Wee/RefreshResponse.html +157 -0
- data/doc/rdoc/classes/Wee/RenderingContext.html +111 -0
- data/doc/rdoc/classes/Wee/Request.html +268 -0
- data/doc/rdoc/classes/Wee/RequestHandler.html +336 -0
- data/doc/rdoc/classes/Wee/Response.html +260 -0
- data/doc/rdoc/classes/Wee/Session.html +469 -0
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +198 -0
- data/doc/rdoc/classes/Wee/Snapshot.html +211 -0
- data/doc/rdoc/classes/Wee/StateHolder.html +149 -0
- data/doc/rdoc/classes/Wee/StateRegistry.html +434 -0
- data/doc/rdoc/classes/Wee/StateRegistry/Snapshot.html +320 -0
- data/doc/rdoc/classes/Wee/StateRegistry/WithObject.html +153 -0
- data/doc/rdoc/classes/Wee/Utils.html +111 -0
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +148 -0
- data/doc/rdoc/classes/Wee/ValueHolder.html +220 -0
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +330 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/INSTALL.html +118 -0
- data/doc/rdoc/files/README.html +466 -0
- data/doc/rdoc/files/lib/cache/cache_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/application_rb.html +112 -0
- data/doc/rdoc/files/lib/wee/callback_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/component_ext_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/component_rb.html +109 -0
- data/doc/rdoc/files/lib/wee/context_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +115 -0
- data/doc/rdoc/files/lib/wee/core/component_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +133 -0
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +112 -0
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +113 -0
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/core_rb.html +131 -0
- data/doc/rdoc/files/lib/wee/decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/holder_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/html_canvas_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/html_writer_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/idgen_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/page_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/presenter_rb.html +112 -0
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/rendering/html/brushes_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/rendering/html/writer_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/request_rb.html +113 -0
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/response_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/session_rb.html +109 -0
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/snapshot_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/state_registry_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/stuff_rb.html +144 -0
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/webrick_rb.html +108 -0
- data/doc/rdoc/files/lib/wee_rb.html +132 -0
- data/doc/rdoc/fr_class_index.html +93 -0
- data/doc/rdoc/fr_file_index.html +51 -0
- data/doc/rdoc/fr_method_index.html +242 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/examples/ObjectSpaceBrowser.rb +199 -0
- data/examples/calendar.rb +366 -0
- data/examples/cc.rb +94 -0
- data/examples/draw.rb +91 -0
- data/examples/example.rb +223 -0
- data/examples/test.rb +66 -0
- data/examples/window.rb +53 -0
- data/lib/cache/cache.rb +9 -0
- data/lib/wee.rb +18 -8
- data/lib/wee/adaptors/webrick.rb +73 -0
- data/lib/wee/application.rb +69 -71
- data/lib/wee/context.rb +2 -12
- data/lib/wee/core.rb +15 -0
- data/lib/wee/core/callback.rb +108 -0
- data/lib/wee/core/component.rb +314 -0
- data/lib/wee/core/decoration.rb +129 -0
- data/lib/wee/core/presenter.rb +132 -0
- data/lib/wee/core/snapshot.rb +21 -0
- data/lib/wee/core/valueholder.rb +19 -0
- data/lib/wee/idgen.rb +13 -0
- data/lib/wee/page.rb +1 -1
- data/lib/wee/renderer/html/brushes.rb +435 -0
- data/lib/wee/renderer/html/canvas.rb +148 -0
- data/lib/wee/{html_writer.rb → renderer/html/writer.rb} +31 -16
- data/lib/wee/request.rb +57 -0
- data/lib/wee/requesthandler.rb +77 -0
- data/lib/wee/response.rb +77 -0
- data/lib/wee/session.rb +70 -64
- data/lib/wee/{snapshot.rb → snapshot_ext.rb} +4 -4
- data/test/components/calltest.rb +16 -0
- data/test/components/counter.rb +17 -0
- data/test/components/messagebox.rb +15 -0
- data/test/components/page.rb +14 -0
- data/test/components/page_decoration.rb +7 -0
- data/test/stress.rb +64 -0
- data/test/test_component.rb +106 -0
- data/test/test_html_canvas.rb +25 -0
- data/test/test_html_writer.rb +27 -0
- data/test/test_request.rb +13 -0
- data/test/utils/cross.rb +65 -0
- data/test/utils/generic_plotter.rb +28 -0
- data/test/utils/gnuplot.rb +31 -0
- data/test/utils/measure_memory.rb +9 -0
- data/test/utils/memory_plotter.rb +10 -0
- data/test/utils/object_plotter.rb +10 -0
- data/test/utils/webrick_background.rb +31 -0
- data/wee.gemspec +22 -0
- metadata +222 -18
- data/lib/wee/component.rb +0 -126
- data/lib/wee/delegate_decoration.rb +0 -22
- data/lib/wee/handler_registry.rb +0 -89
- data/lib/wee/holder.rb +0 -14
- data/lib/wee/html_canvas.rb +0 -379
- data/lib/wee/state_registry.rb +0 -173
- data/lib/wee/stuff.rb +0 -29
- data/lib/wee/webrick.rb +0 -15
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.8 $> apache-2.0
|
|
2
|
+
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
|
3
|
+
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
|
|
4
|
+
|
|
5
|
+
Benchmarking localhost (be patient)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Server Software: WEBrick/1.3.1
|
|
9
|
+
Server Hostname: localhost
|
|
10
|
+
Server Port: 2000
|
|
11
|
+
|
|
12
|
+
Document Path: /counter/s:1/p:0
|
|
13
|
+
Document Length: 3728 bytes
|
|
14
|
+
|
|
15
|
+
Concurrency Level: 1
|
|
16
|
+
Time taken for tests: 23.491602 seconds
|
|
17
|
+
Complete requests: 2000
|
|
18
|
+
Failed requests: 0
|
|
19
|
+
Write errors: 0
|
|
20
|
+
Total transferred: 7796000 bytes
|
|
21
|
+
HTML transferred: 7456000 bytes
|
|
22
|
+
Requests per second: 85.14 [#/sec] (mean)
|
|
23
|
+
Time per request: 11.746 [ms] (mean)
|
|
24
|
+
Time per request: 11.746 [ms] (mean, across all concurrent requests)
|
|
25
|
+
Transfer rate: 324.07 [Kbytes/sec] received
|
|
26
|
+
|
|
27
|
+
Connection Times (ms)
|
|
28
|
+
min mean[+/-sd] median max
|
|
29
|
+
Connect: 0 0 0.4 0 8
|
|
30
|
+
Processing: 7 11 5.0 8 45
|
|
31
|
+
Waiting: 0 6 5.6 6 44
|
|
32
|
+
Total: 7 11 5.0 8 45
|
|
33
|
+
|
|
34
|
+
Percentage of the requests served within a certain time (ms)
|
|
35
|
+
50% 8
|
|
36
|
+
66% 9
|
|
37
|
+
75% 11
|
|
38
|
+
80% 17
|
|
39
|
+
90% 18
|
|
40
|
+
95% 19
|
|
41
|
+
98% 20
|
|
42
|
+
99% 30
|
|
43
|
+
100% 45 (longest request)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.8 $> apache-2.0
|
|
2
|
+
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
|
3
|
+
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
|
|
4
|
+
|
|
5
|
+
Benchmarking localhost (be patient)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Server Software: WEBrick/1.3.1
|
|
9
|
+
Server Hostname: localhost
|
|
10
|
+
Server Port: 2000
|
|
11
|
+
|
|
12
|
+
Document Path: /counter.html
|
|
13
|
+
Document Length: 3728 bytes
|
|
14
|
+
|
|
15
|
+
Concurrency Level: 1
|
|
16
|
+
Time taken for tests: 6.5092 seconds
|
|
17
|
+
Complete requests: 2000
|
|
18
|
+
Failed requests: 0
|
|
19
|
+
Write errors: 0
|
|
20
|
+
Total transferred: 7942000 bytes
|
|
21
|
+
HTML transferred: 7456000 bytes
|
|
22
|
+
Requests per second: 333.05 [#/sec] (mean)
|
|
23
|
+
Time per request: 3.003 [ms] (mean)
|
|
24
|
+
Time per request: 3.003 [ms] (mean, across all concurrent requests)
|
|
25
|
+
Transfer rate: 1291.40 [Kbytes/sec] received
|
|
26
|
+
|
|
27
|
+
Connection Times (ms)
|
|
28
|
+
min mean[+/-sd] median max
|
|
29
|
+
Connect: 0 0 0.5 0 7
|
|
30
|
+
Processing: 2 2 2.2 2 32
|
|
31
|
+
Waiting: 0 0 1.9 0 31
|
|
32
|
+
Total: 2 2 2.3 2 32
|
|
33
|
+
|
|
34
|
+
Percentage of the requests served within a certain time (ms)
|
|
35
|
+
50% 2
|
|
36
|
+
66% 2
|
|
37
|
+
75% 2
|
|
38
|
+
80% 2
|
|
39
|
+
90% 3
|
|
40
|
+
95% 9
|
|
41
|
+
98% 10
|
|
42
|
+
99% 10
|
|
43
|
+
100% 32 (longest request)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.8 $> apache-2.0
|
|
2
|
+
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
|
3
|
+
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
|
|
4
|
+
|
|
5
|
+
Benchmarking localhost (be patient)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Server Software: WEBrick/1.3.1
|
|
9
|
+
Server Hostname: localhost
|
|
10
|
+
Server Port: 2000
|
|
11
|
+
|
|
12
|
+
Document Path: /counter/s:1/p:0/h:1
|
|
13
|
+
Document Length: 62 bytes
|
|
14
|
+
|
|
15
|
+
Concurrency Level: 1
|
|
16
|
+
Time taken for tests: 47.402115 seconds
|
|
17
|
+
Complete requests: 2000
|
|
18
|
+
Failed requests: 1991
|
|
19
|
+
(Connect: 0, Length: 1991, Exceptions: 0)
|
|
20
|
+
Write errors: 0
|
|
21
|
+
Non-2xx responses: 2000
|
|
22
|
+
Total transferred: 552679 bytes
|
|
23
|
+
HTML transferred: 133786 bytes
|
|
24
|
+
Requests per second: 42.19 [#/sec] (mean)
|
|
25
|
+
Time per request: 23.701 [ms] (mean)
|
|
26
|
+
Time per request: 23.701 [ms] (mean, across all concurrent requests)
|
|
27
|
+
Transfer rate: 11.37 [Kbytes/sec] received
|
|
28
|
+
|
|
29
|
+
Connection Times (ms)
|
|
30
|
+
min mean[+/-sd] median max
|
|
31
|
+
Connect: 0 0 1.0 1 7
|
|
32
|
+
Processing: 14 22 14.9 17 186
|
|
33
|
+
Waiting: 4 17 15.3 14 182
|
|
34
|
+
Total: 15 22 14.9 18 187
|
|
35
|
+
WARNING: The median and mean for the initial connection time are not within a normal deviation
|
|
36
|
+
These results are probably not that reliable.
|
|
37
|
+
|
|
38
|
+
Percentage of the requests served within a certain time (ms)
|
|
39
|
+
50% 18
|
|
40
|
+
66% 20
|
|
41
|
+
75% 21
|
|
42
|
+
80% 24
|
|
43
|
+
90% 39
|
|
44
|
+
95% 41
|
|
45
|
+
98% 45
|
|
46
|
+
99% 122
|
|
47
|
+
100% 187 (longest request)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.8 $> apache-2.0
|
|
2
|
+
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
|
3
|
+
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
|
|
4
|
+
|
|
5
|
+
Benchmarking localhost (be patient)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Server Software: WEBrick/1.3.1
|
|
9
|
+
Server Hostname: localhost
|
|
10
|
+
Server Port: 2000
|
|
11
|
+
|
|
12
|
+
Document Path: /counter/s:1/p:0
|
|
13
|
+
Document Length: 3728 bytes
|
|
14
|
+
|
|
15
|
+
Concurrency Level: 1
|
|
16
|
+
Time taken for tests: 53.215675 seconds
|
|
17
|
+
Complete requests: 2000
|
|
18
|
+
Failed requests: 0
|
|
19
|
+
Write errors: 0
|
|
20
|
+
Total transferred: 7796000 bytes
|
|
21
|
+
HTML transferred: 7456000 bytes
|
|
22
|
+
Requests per second: 37.58 [#/sec] (mean)
|
|
23
|
+
Time per request: 26.608 [ms] (mean)
|
|
24
|
+
Time per request: 26.608 [ms] (mean, across all concurrent requests)
|
|
25
|
+
Transfer rate: 143.06 [Kbytes/sec] received
|
|
26
|
+
|
|
27
|
+
Connection Times (ms)
|
|
28
|
+
min mean[+/-sd] median max
|
|
29
|
+
Connect: 0 0 1.0 1 8
|
|
30
|
+
Processing: 15 24 14.6 19 167
|
|
31
|
+
Waiting: 5 20 14.8 16 165
|
|
32
|
+
Total: 16 25 14.6 20 168
|
|
33
|
+
WARNING: The median and mean for the initial connection time are not within a normal deviation
|
|
34
|
+
These results are probably not that reliable.
|
|
35
|
+
|
|
36
|
+
Percentage of the requests served within a certain time (ms)
|
|
37
|
+
50% 20
|
|
38
|
+
66% 22
|
|
39
|
+
75% 28
|
|
40
|
+
80% 39
|
|
41
|
+
90% 42
|
|
42
|
+
95% 44
|
|
43
|
+
98% 48
|
|
44
|
+
99% 76
|
|
45
|
+
100% 168 (longest request)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.8 $> apache-2.0
|
|
2
|
+
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
|
3
|
+
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
|
|
4
|
+
|
|
5
|
+
Benchmarking localhost (be patient)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Server Software: WEBrick/1.3.1
|
|
9
|
+
Server Hostname: localhost
|
|
10
|
+
Server Port: 2000
|
|
11
|
+
|
|
12
|
+
Document Path: /counter.html
|
|
13
|
+
Document Length: 3728 bytes
|
|
14
|
+
|
|
15
|
+
Concurrency Level: 1
|
|
16
|
+
Time taken for tests: 14.912528 seconds
|
|
17
|
+
Complete requests: 2000
|
|
18
|
+
Failed requests: 0
|
|
19
|
+
Write errors: 0
|
|
20
|
+
Total transferred: 7942000 bytes
|
|
21
|
+
HTML transferred: 7456000 bytes
|
|
22
|
+
Requests per second: 134.12 [#/sec] (mean)
|
|
23
|
+
Time per request: 7.456 [ms] (mean)
|
|
24
|
+
Time per request: 7.456 [ms] (mean, across all concurrent requests)
|
|
25
|
+
Transfer rate: 520.03 [Kbytes/sec] received
|
|
26
|
+
|
|
27
|
+
Connection Times (ms)
|
|
28
|
+
min mean[+/-sd] median max
|
|
29
|
+
Connect: 0 0 0.8 0 10
|
|
30
|
+
Processing: 3 6 16.4 4 575
|
|
31
|
+
Waiting: 0 3 16.3 1 568
|
|
32
|
+
Total: 4 6 16.5 4 576
|
|
33
|
+
|
|
34
|
+
Percentage of the requests served within a certain time (ms)
|
|
35
|
+
50% 4
|
|
36
|
+
66% 5
|
|
37
|
+
75% 5
|
|
38
|
+
80% 6
|
|
39
|
+
90% 8
|
|
40
|
+
95% 20
|
|
41
|
+
98% 23
|
|
42
|
+
99% 25
|
|
43
|
+
100% 576 (longest request)
|
data/benchmark/Makefile
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
N=2000
|
|
2
|
+
|
|
3
|
+
RUBY=ruby
|
|
4
|
+
|
|
5
|
+
all: bench1 bench2
|
|
6
|
+
echo "DONE"
|
|
7
|
+
|
|
8
|
+
start_counter:
|
|
9
|
+
# start the counter app
|
|
10
|
+
$(RUBY) counter.rb 2000 > /dev/null 2> /dev/null &
|
|
11
|
+
sleep 3
|
|
12
|
+
|
|
13
|
+
stop_counter:
|
|
14
|
+
kill -9 `cat counter.2000.pid`
|
|
15
|
+
rm -f counter.2000.pid
|
|
16
|
+
rm -f dump
|
|
17
|
+
|
|
18
|
+
bench_counter:
|
|
19
|
+
# generate initial session and first page
|
|
20
|
+
fetch -o counter.html http://localhost:2000/counter
|
|
21
|
+
|
|
22
|
+
# perform benchmark
|
|
23
|
+
ab -n ${N} http://localhost:2000/counter/s:1/p:1 > result.${N}.counter.render
|
|
24
|
+
ab -n ${N} http://localhost:2000/counter/s:1/p:1/h:1 > result.${N}.counter.action
|
|
25
|
+
|
|
26
|
+
start_filehandler:
|
|
27
|
+
# start the filehandler app
|
|
28
|
+
$(RUBY) filehandler.rb > /dev/null 2> /dev/null &
|
|
29
|
+
sleep 3
|
|
30
|
+
|
|
31
|
+
stop_filehandler:
|
|
32
|
+
kill -9 `cat filehandler.pid`
|
|
33
|
+
rm -f filehandler.pid
|
|
34
|
+
|
|
35
|
+
bench_filehandler:
|
|
36
|
+
ab -n ${N} http://localhost:2000/counter.html > result.${N}.filehandler
|
|
37
|
+
|
|
38
|
+
clean:
|
|
39
|
+
rm -f counter.2000.pid
|
|
40
|
+
rm -f filehandler.pid
|
|
41
|
+
rm -f dump
|
|
42
|
+
rm -f result.${N}.*
|
|
43
|
+
rm -f counter.html
|
|
44
|
+
|
|
45
|
+
bench1: start_counter bench_counter stop_counter
|
|
46
|
+
bench2: start_filehandler bench_filehandler stop_filehandler
|
|
47
|
+
|
|
48
|
+
|
data/benchmark/bench.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
N=1000
|
|
2
|
+
ports="2010 2011"
|
|
3
|
+
|
|
4
|
+
for port in $ports; do
|
|
5
|
+
ruby counter.rb $port & #> /dev/null 2> /dev/null &
|
|
6
|
+
done
|
|
7
|
+
sleep 5
|
|
8
|
+
for port in $ports; do
|
|
9
|
+
fetch -o - http://localhost:$port/counter > /dev/null
|
|
10
|
+
done
|
|
11
|
+
|
|
12
|
+
date
|
|
13
|
+
for port in $ports; do
|
|
14
|
+
ab -n ${N} http://localhost:$port/counter/s:1/p:0 > result.render.$port &
|
|
15
|
+
ab -n ${N} http://localhost:$port/counter/s:1/p:0/h:1 > result.action.$port &
|
|
16
|
+
done
|
|
17
|
+
date
|
|
18
|
+
|
|
19
|
+
for port in $ports; do
|
|
20
|
+
kill -9 `cat counter.$port.pid`
|
|
21
|
+
rm -f counter.$port.pid
|
|
22
|
+
done
|
|
23
|
+
wait
|
|
24
|
+
date
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
$LOAD_PATH.unshift '../lib'
|
|
2
|
+
require 'wee'
|
|
3
|
+
require 'wee/webrick'
|
|
4
|
+
require 'wee/utils/cache'
|
|
5
|
+
|
|
6
|
+
class Counter < Wee::Component
|
|
7
|
+
def initialize(cnt)
|
|
8
|
+
super()
|
|
9
|
+
@cnt = cnt
|
|
10
|
+
@show_edit_field = false
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def backtrack_state(snap)
|
|
14
|
+
super
|
|
15
|
+
snap.add(self)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def dec
|
|
19
|
+
@cnt -= 1
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def inc
|
|
23
|
+
@cnt += 1
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def render
|
|
27
|
+
r.form.action(:submit).with do
|
|
28
|
+
r.anchor.action(:dec).with("--")
|
|
29
|
+
r.space
|
|
30
|
+
|
|
31
|
+
if @show_edit_field
|
|
32
|
+
r.text_input.assign(:cnt=).value(@cnt).size(6)
|
|
33
|
+
else
|
|
34
|
+
r.anchor.action(:submit).with(@cnt)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
r.space
|
|
38
|
+
r.anchor.action(:inc).with("++")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def submit
|
|
43
|
+
@show_edit_field = !@show_edit_field
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def cnt
|
|
47
|
+
@cnt
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def cnt=(val)
|
|
51
|
+
if val =~ /^\d+$/
|
|
52
|
+
@cnt = val.to_i
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class Main < Wee::Component
|
|
58
|
+
def initialize
|
|
59
|
+
super()
|
|
60
|
+
@counters = (1..20).map {|i| Counter.new(i)}
|
|
61
|
+
children.push(*@counters)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def render
|
|
65
|
+
r.page.title("Counter Test").with do
|
|
66
|
+
@counters.each { |cnt| r.render(cnt) }
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class MySession < Wee::Session
|
|
72
|
+
def initialize
|
|
73
|
+
super do
|
|
74
|
+
self.root_component = Main.new
|
|
75
|
+
self.page_store = Wee::Utils::LRUCache.new(10) # backtrack up to 10 pages
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
class MyApplication < Wee::Application
|
|
81
|
+
def setup_session_id_generator
|
|
82
|
+
@session_cnt = 0
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __FILE__ == $0
|
|
88
|
+
PORT = (ARGV[0] || 2000).to_i
|
|
89
|
+
File.open("counter.#{ PORT }.pid", 'w+') {|f| f.puts($$.to_s) }
|
|
90
|
+
MyApplication.new {|app|
|
|
91
|
+
app.name = 'Counter'
|
|
92
|
+
app.path = '/counter'
|
|
93
|
+
app.session_class = MySession
|
|
94
|
+
app.session_store = Wee::Utils::LRUCache.new(100) # handle up to 100 sessions
|
|
95
|
+
}.start(:Port => PORT)
|
|
96
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
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: Array</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">Array</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/wee/snapshot_ext_rb.html">
|
|
59
|
+
lib/wee/snapshot_ext.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
|
+
<a href="Object.html">
|
|
69
|
+
Object
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div id="method-list">
|
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
|
89
|
+
|
|
90
|
+
<div class="name-list">
|
|
91
|
+
<a href="#M000004">restore_snapshot</a>
|
|
92
|
+
<a href="#M000003">take_snapshot</a>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<!-- if includes -->
|
|
100
|
+
|
|
101
|
+
<div id="section">
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<!-- if method_list -->
|
|
111
|
+
<div id="methods">
|
|
112
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
113
|
+
|
|
114
|
+
<div id="method-M000004" class="method-detail">
|
|
115
|
+
<a name="M000004"></a>
|
|
116
|
+
|
|
117
|
+
<div class="method-heading">
|
|
118
|
+
<a href="#M000004" class="method-signature">
|
|
119
|
+
<span class="method-name">restore_snapshot</span><span class="method-args">(snap)</span>
|
|
120
|
+
</a>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="method-description">
|
|
124
|
+
<p><a class="source-toggle" href="#"
|
|
125
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
126
|
+
<div class="method-source-code" id="M000004-source">
|
|
127
|
+
<pre>
|
|
128
|
+
<span class="ruby-comment cmt"># File lib/wee/snapshot_ext.rb, line 22</span>
|
|
129
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_snapshot</span>(<span class="ruby-identifier">snap</span>)
|
|
130
|
+
<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">snap</span>)
|
|
131
|
+
<span class="ruby-keyword kw">end</span>
|
|
132
|
+
</pre>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div id="method-M000003" class="method-detail">
|
|
138
|
+
<a name="M000003"></a>
|
|
139
|
+
|
|
140
|
+
<div class="method-heading">
|
|
141
|
+
<a href="#M000003" class="method-signature">
|
|
142
|
+
<span class="method-name">take_snapshot</span><span class="method-args">()</span>
|
|
143
|
+
</a>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div class="method-description">
|
|
147
|
+
<p><a class="source-toggle" href="#"
|
|
148
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
149
|
+
<div class="method-source-code" id="M000003-source">
|
|
150
|
+
<pre>
|
|
151
|
+
<span class="ruby-comment cmt"># File lib/wee/snapshot_ext.rb, line 18</span>
|
|
152
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take_snapshot</span>
|
|
153
|
+
<span class="ruby-identifier">dup</span>
|
|
154
|
+
<span class="ruby-keyword kw">end</span>
|
|
155
|
+
</pre>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
<div id="validator-badges">
|
|
168
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
</body>
|
|
172
|
+
</html>
|