nitro 0.8.0 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +3 -4
- data/ChangeLog +418 -0
- data/LICENSE +1 -1
- data/README +157 -89
- data/RELEASES +50 -0
- data/Rakefile +5 -7
- data/benchmark/nitro/bench.rb +5 -0
- data/benchmark/nitro/simple-webrick-n-200.txt +44 -0
- data/benchmark/nitro/static-webrick-n-200.txt +43 -0
- data/benchmark/nitro/tiny-lhttpd-n-200-c-5.txt +43 -0
- data/benchmark/nitro/tiny-webrick-n-200-c-5.txt +44 -0
- data/benchmark/nitro/tiny-webrick-n-200.txt +44 -0
- data/benchmark/nitro/tiny2-webrick-n-200.txt +44 -0
- data/{lib/nitro/server/cluster.rb → bin/cluster} +26 -30
- data/bin/proto/README +2 -2
- data/bin/proto/{apache.conf → conf/apache.conf} +0 -0
- data/bin/proto/conf/app.conf.rb +22 -0
- data/bin/proto/conf/lhttpd.conf +236 -0
- data/bin/proto/ctl +4 -0
- data/bin/proto/lib/README +5 -0
- data/bin/proto/log/README +3 -0
- data/bin/proto/root/fcgi.rb +6 -0
- data/bin/proto/root/index.xhtml +65 -7
- data/bin/proto/root/m/nitro.png +0 -0
- data/examples/blog/README +7 -5
- data/examples/blog/{apache.conf → conf/apache.conf} +0 -0
- data/examples/blog/conf/app.conf.rb +56 -0
- data/examples/blog/conf/lhttpd.conf +236 -0
- data/examples/blog/ctl +4 -0
- data/examples/blog/lib/blog.rb +11 -136
- data/examples/blog/lib/blog/controller.rb +99 -0
- data/examples/blog/lib/blog/model.rb +39 -0
- data/examples/blog/log/README +3 -0
- data/examples/blog/root/comments.xhtml +2 -2
- data/examples/blog/root/fcgi.rb +6 -0
- data/examples/blog/root/index.xhtml +4 -5
- data/examples/blog/root/login.xhtml +2 -2
- data/examples/blog/root/style.xsl +9 -9
- data/examples/blog/root/view_entry.xhtml +2 -2
- data/examples/flash/conf/app.conf.rb +23 -0
- data/examples/flash/ctl +4 -0
- data/examples/flash/log/README +3 -0
- data/examples/flash/root/index.xhtml +0 -9
- data/examples/flash/root/show_inline_text.xhtml +10 -5
- data/examples/no_xsl_blog/README +12 -0
- data/examples/no_xsl_blog/conf/apache.conf +0 -0
- data/examples/no_xsl_blog/conf/app.conf.rb +57 -0
- data/examples/no_xsl_blog/conf/lhttpd.conf +236 -0
- data/examples/no_xsl_blog/ctl +4 -0
- data/examples/no_xsl_blog/lib/blog.rb +20 -0
- data/examples/no_xsl_blog/lib/blog/controller.rb +102 -0
- data/examples/no_xsl_blog/lib/blog/model.rb +39 -0
- data/examples/no_xsl_blog/lib/blog/template.rb +134 -0
- data/examples/no_xsl_blog/log/README +3 -0
- data/examples/no_xsl_blog/root/comments.xhtml +41 -0
- data/examples/no_xsl_blog/root/entry_form.xhtml +22 -0
- data/examples/no_xsl_blog/root/fcgi.rb +6 -0
- data/examples/no_xsl_blog/root/index.xhtml +39 -0
- data/examples/no_xsl_blog/root/login.xhtml +21 -0
- data/examples/no_xsl_blog/root/m/bubbles.gif +0 -0
- data/examples/no_xsl_blog/root/m/comments_curve.gif +0 -0
- data/examples/no_xsl_blog/root/m/down.gif +0 -0
- data/examples/no_xsl_blog/root/m/footer_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/garrow.gif +0 -0
- data/examples/no_xsl_blog/root/m/gbull.gif +0 -0
- data/examples/no_xsl_blog/root/m/grbull.gif +0 -0
- data/examples/no_xsl_blog/root/m/h1_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/header_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/nitro.gif +0 -0
- data/examples/no_xsl_blog/root/m/obull.gif +0 -0
- data/examples/no_xsl_blog/root/m/page_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/rss.gif +0 -0
- data/examples/no_xsl_blog/root/m/side_title_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/sidebar_bg.gif +0 -0
- data/examples/no_xsl_blog/root/recent_posts.xhtml +14 -0
- data/examples/no_xsl_blog/root/style.css +301 -0
- data/examples/no_xsl_blog/root/view_entry.xhtml +25 -0
- data/examples/no_xsl_blog/root/view_entry.xml +12 -0
- data/examples/og/run.rb +2 -2
- data/examples/tiny/README +2 -2
- data/examples/tiny/conf/apache.conf +5 -0
- data/examples/tiny/conf/app.conf.rb +21 -0
- data/examples/tiny/conf/lhttpd.conf +236 -0
- data/examples/tiny/ctl +4 -0
- data/examples/tiny/log/README +3 -0
- data/examples/tiny/root/fcgi.rb +6 -0
- data/examples/tiny/root/index.xhtml +7 -4
- data/examples/tiny/root/nitro.png +0 -0
- data/lib/glue.rb +13 -9
- data/lib/glue/array.rb +1 -1
- data/lib/glue/cache.rb +1 -1
- data/lib/glue/flexob.rb +12 -0
- data/lib/glue/hash.rb +1 -1
- data/lib/glue/inflector.rb +2 -2
- data/lib/glue/logger.rb +4 -8
- data/lib/glue/misc.rb +14 -0
- data/lib/glue/number.rb +1 -1
- data/lib/glue/object.rb +26 -0
- data/lib/glue/pool.rb +1 -1
- data/lib/glue/property.rb +84 -91
- data/lib/glue/string.rb +1 -1
- data/lib/glue/time.rb +1 -1
- data/lib/glue/validation.rb +1 -1
- data/lib/nitro.rb +18 -6
- data/lib/nitro/adaptors/cgi.rb +291 -0
- data/lib/nitro/adaptors/fastcgi.rb +42 -0
- data/lib/nitro/adaptors/runner.rb +123 -0
- data/lib/nitro/adaptors/webrick.rb +110 -0
- data/lib/nitro/buffering.rb +43 -0
- data/lib/nitro/builders/form.rb +1 -1
- data/lib/nitro/builders/rss.rb +1 -1
- data/{bin → lib/nitro}/cluster.rb +26 -30
- data/lib/nitro/context.rb +82 -0
- data/lib/nitro/controller.rb +50 -0
- data/lib/nitro/cookie.rb +46 -0
- data/lib/nitro/dispatcher.rb +105 -0
- data/lib/nitro/filters.rb +9 -10
- data/lib/nitro/localization.rb +42 -0
- data/lib/nitro/mail.rb +11 -14
- data/lib/nitro/render.rb +275 -0
- data/lib/nitro/request.rb +128 -0
- data/lib/nitro/response.rb +38 -0
- data/lib/nitro/scaffold.rb +11 -11
- data/lib/nitro/session.rb +84 -0
- data/lib/nitro/{server/shaders.rb → shaders.rb} +56 -36
- data/lib/nitro/ui/pager.rb +23 -26
- data/lib/nitro/{sitemap.rb → ui/sitemap.rb} +4 -12
- data/lib/nitro/uri.rb +1 -1
- data/lib/nitro/version.rb +10 -8
- data/lib/og.rb +66 -65
- data/lib/og/backend.rb +1 -1
- data/lib/og/backends/mysql.rb +48 -52
- data/lib/og/backends/psql.rb +34 -37
- data/lib/og/connection.rb +15 -15
- data/lib/og/enchant.rb +16 -9
- data/lib/og/meta.rb +127 -54
- data/lib/og/mock.rb +18 -18
- data/lib/og/version.rb +6 -4
- data/lib/parts/content.rb +4 -8
- data/test/glue/tc_logger.rb +3 -0
- data/test/glue/tc_property.rb +19 -3
- data/test/nitro/adaptors/tc_cgi.rb +63 -0
- data/test/nitro/adaptors/tc_webrick.rb +15 -0
- data/test/nitro/builders/tc_xml.rb +2 -2
- data/test/nitro/tc_context.rb +13 -0
- data/test/nitro/tc_controller.rb +47 -0
- data/test/nitro/tc_dispatcher.rb +64 -0
- data/test/nitro/tc_session.rb +20 -0
- data/test/nitro/{tc_sitemap.rb → ui/tc_sitemap.rb} +1 -1
- data/test/root/blog/list.xhtml +6 -0
- data/test/tc_og.rb +41 -4
- metadata +115 -59
- data/bin/proto/app.rb +0 -20
- data/bin/proto/config.rb +0 -77
- data/examples/blog/app.rb +0 -21
- data/examples/blog/config.rb +0 -95
- data/examples/blog/env.rb +0 -22
- data/examples/flash/README +0 -34
- data/examples/flash/app.rb +0 -20
- data/examples/flash/config.rb +0 -38
- data/examples/flash/lib/flash.rb +0 -40
- data/examples/flash/tmp.swf +0 -0
- data/examples/tiny/app.rb +0 -19
- data/examples/tiny/config.rb +0 -29
- data/examples/tiny/root/nitro-small.png +0 -0
- data/lib/nitro/application.rb +0 -217
- data/lib/nitro/config.rb +0 -128
- data/lib/nitro/events.rb +0 -122
- data/lib/nitro/html.rb +0 -151
- data/lib/nitro/http.rb +0 -102
- data/lib/nitro/l10n.rb +0 -30
- data/lib/nitro/server.rb +0 -59
- data/lib/nitro/server/appserver.rb +0 -67
- data/lib/nitro/server/cookie.rb +0 -87
- data/lib/nitro/server/dispatcher.rb +0 -62
- data/lib/nitro/server/filters.rb +0 -75
- data/lib/nitro/server/filters/autologin.rb +0 -51
- data/lib/nitro/server/fragment.rb +0 -70
- data/lib/nitro/server/handlers.rb +0 -127
- data/lib/nitro/server/render.rb +0 -426
- data/lib/nitro/server/request.rb +0 -658
- data/lib/nitro/server/requestpart.rb +0 -54
- data/lib/nitro/server/script.rb +0 -387
- data/lib/nitro/server/server.rb +0 -57
- data/lib/nitro/server/session.rb +0 -220
- data/lib/nitro/server/user.rb +0 -46
- data/lib/nitro/server/webrick.rb +0 -180
- data/lib/nitro/service.rb +0 -26
- data/lib/xsl/ui.xsl +0 -51
- data/lib/xsl/xforms.xsl +0 -28
- data/test/nitro/server/tc_cookie.rb +0 -34
- data/test/nitro/server/tc_filters.rb +0 -38
- data/test/nitro/server/tc_request.rb +0 -70
- data/test/nitro/server/tc_requestpart.rb +0 -28
- data/test/nitro/server/tc_session.rb +0 -34
- data/test/nitro/tc_events.rb +0 -44
- data/test/nitro/tc_html.rb +0 -79
- data/test/nitro/tc_http.rb +0 -18
data/Rakefile
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# code:
|
2
1
|
# * George Moschovitis <gm@navel.gr>
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# $Id: connection.rb 71 2004-10-18 10:50:22Z gmosx $
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
+
# $Id$
|
6
4
|
|
7
5
|
require "rake"
|
8
6
|
require "rake/rdoctask"
|
@@ -52,7 +50,7 @@ if 'nitro' == project
|
|
52
50
|
#
|
53
51
|
require "lib/nitro/version"
|
54
52
|
|
55
|
-
PKG_VERSION =
|
53
|
+
PKG_VERSION = Nitro::Version
|
56
54
|
PKG_FILES = FileList[
|
57
55
|
"[A-Z]*", "{bin,benchmark,etc,ext,examples,doc,lib,test,vendor}/**/*"
|
58
56
|
# "examples/*.rb"
|
@@ -87,7 +85,7 @@ else
|
|
87
85
|
#
|
88
86
|
require "lib/og/version"
|
89
87
|
|
90
|
-
PKG_VERSION =
|
88
|
+
PKG_VERSION = Og::Version
|
91
89
|
PKG_FILES = FileList[
|
92
90
|
"README.og", "RELEASES.og", "LICENSE", "AUTHORS", "Rakefile", "ChangeLog*",
|
93
91
|
"examples/og/*", "lib/glue.rb", "lib/glue/**/*", "lib/og/**/*", "lib/og.rb",
|
@@ -114,7 +112,7 @@ else
|
|
114
112
|
s.author = "George Moschovitis"
|
115
113
|
s.email = "gm@navel.gr"
|
116
114
|
s.homepage = "http://www.navel.gr/og"
|
117
|
-
s.rubyforge_project = "
|
115
|
+
s.rubyforge_project = "nitro"
|
118
116
|
end
|
119
117
|
|
120
118
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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: 8080
|
11
|
+
|
12
|
+
Document Path: /index2
|
13
|
+
Document Length: 42 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 1
|
16
|
+
Time taken for tests: 4.644158 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Non-2xx responses: 200
|
21
|
+
Total transferred: 51200 bytes
|
22
|
+
HTML transferred: 8400 bytes
|
23
|
+
Requests per second: 43.06 [#/sec] (mean)
|
24
|
+
Time per request: 23.221 [ms] (mean)
|
25
|
+
Time per request: 23.221 [ms] (mean, across all concurrent requests)
|
26
|
+
Transfer rate: 10.77 [Kbytes/sec] received
|
27
|
+
|
28
|
+
Connection Times (ms)
|
29
|
+
min mean[+/-sd] median max
|
30
|
+
Connect: 1 1 2.2 1 31
|
31
|
+
Processing: 15 20 11.2 18 89
|
32
|
+
Waiting: 0 0 0.0 0 0
|
33
|
+
Total: 16 22 11.3 19 90
|
34
|
+
|
35
|
+
Percentage of the requests served within a certain time (ms)
|
36
|
+
50% 19
|
37
|
+
66% 19
|
38
|
+
75% 19
|
39
|
+
80% 20
|
40
|
+
90% 48
|
41
|
+
95% 52
|
42
|
+
98% 55
|
43
|
+
99% 56
|
44
|
+
100% 90 (longest request)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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: 8080
|
11
|
+
|
12
|
+
Document Path: /test.html
|
13
|
+
Document Length: 18 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 1
|
16
|
+
Time taken for tests: 4.108503 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Total transferred: 51400 bytes
|
21
|
+
HTML transferred: 3600 bytes
|
22
|
+
Requests per second: 48.68 [#/sec] (mean)
|
23
|
+
Time per request: 20.543 [ms] (mean)
|
24
|
+
Time per request: 20.543 [ms] (mean, across all concurrent requests)
|
25
|
+
Transfer rate: 12.17 [Kbytes/sec] received
|
26
|
+
|
27
|
+
Connection Times (ms)
|
28
|
+
min mean[+/-sd] median max
|
29
|
+
Connect: 0 0 2.2 0 30
|
30
|
+
Processing: 14 19 10.2 16 59
|
31
|
+
Waiting: 0 11 12.2 13 58
|
32
|
+
Total: 14 19 10.4 16 59
|
33
|
+
|
34
|
+
Percentage of the requests served within a certain time (ms)
|
35
|
+
50% 16
|
36
|
+
66% 17
|
37
|
+
75% 17
|
38
|
+
80% 18
|
39
|
+
90% 44
|
40
|
+
95% 48
|
41
|
+
98% 50
|
42
|
+
99% 50
|
43
|
+
100% 59 (longest request)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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:
|
9
|
+
Server Hostname: localhost
|
10
|
+
Server Port: 8080
|
11
|
+
|
12
|
+
Document Path: /index
|
13
|
+
Document Length: 892 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 5
|
16
|
+
Time taken for tests: 0.887273 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Total transferred: 201200 bytes
|
21
|
+
HTML transferred: 178400 bytes
|
22
|
+
Requests per second: 225.41 [#/sec] (mean)
|
23
|
+
Time per request: 22.182 [ms] (mean)
|
24
|
+
Time per request: 4.436 [ms] (mean, across all concurrent requests)
|
25
|
+
Transfer rate: 220.90 [Kbytes/sec] received
|
26
|
+
|
27
|
+
Connection Times (ms)
|
28
|
+
min mean[+/-sd] median max
|
29
|
+
Connect: 0 0 1.0 0 8
|
30
|
+
Processing: 5 21 16.0 14 88
|
31
|
+
Waiting: 1 20 16.1 14 87
|
32
|
+
Total: 6 21 16.1 14 88
|
33
|
+
|
34
|
+
Percentage of the requests served within a certain time (ms)
|
35
|
+
50% 14
|
36
|
+
66% 15
|
37
|
+
75% 16
|
38
|
+
80% 32
|
39
|
+
90% 46
|
40
|
+
95% 47
|
41
|
+
98% 87
|
42
|
+
99% 88
|
43
|
+
100% 88 (longest request)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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: 8080
|
11
|
+
|
12
|
+
Document Path: /index
|
13
|
+
Document Length: 417 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 5
|
16
|
+
Time taken for tests: 6.968057 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Non-2xx responses: 202
|
21
|
+
Total transferred: 127664 bytes
|
22
|
+
HTML transferred: 84234 bytes
|
23
|
+
Requests per second: 28.70 [#/sec] (mean)
|
24
|
+
Time per request: 174.201 [ms] (mean)
|
25
|
+
Time per request: 34.840 [ms] (mean, across all concurrent requests)
|
26
|
+
Transfer rate: 17.80 [Kbytes/sec] received
|
27
|
+
|
28
|
+
Connection Times (ms)
|
29
|
+
min mean[+/-sd] median max
|
30
|
+
Connect: 0 14 29.1 0 119
|
31
|
+
Processing: 25 156 71.1 163 446
|
32
|
+
Waiting: 0 113 61.8 115 394
|
33
|
+
Total: 94 170 53.7 163 446
|
34
|
+
|
35
|
+
Percentage of the requests served within a certain time (ms)
|
36
|
+
50% 163
|
37
|
+
66% 188
|
38
|
+
75% 196
|
39
|
+
80% 199
|
40
|
+
90% 210
|
41
|
+
95% 221
|
42
|
+
98% 409
|
43
|
+
99% 425
|
44
|
+
100% 446 (longest request)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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: 8080
|
11
|
+
|
12
|
+
Document Path: /index
|
13
|
+
Document Length: 417 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 1
|
16
|
+
Time taken for tests: 4.214142 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Non-2xx responses: 200
|
21
|
+
Total transferred: 126400 bytes
|
22
|
+
HTML transferred: 83400 bytes
|
23
|
+
Requests per second: 47.46 [#/sec] (mean)
|
24
|
+
Time per request: 21.071 [ms] (mean)
|
25
|
+
Time per request: 21.071 [ms] (mean, across all concurrent requests)
|
26
|
+
Transfer rate: 29.19 [Kbytes/sec] received
|
27
|
+
|
28
|
+
Connection Times (ms)
|
29
|
+
min mean[+/-sd] median max
|
30
|
+
Connect: 0 0 0.2 0 2
|
31
|
+
Processing: 14 20 11.3 16 86
|
32
|
+
Waiting: 0 18 11.5 15 85
|
33
|
+
Total: 14 20 11.3 16 86
|
34
|
+
|
35
|
+
Percentage of the requests served within a certain time (ms)
|
36
|
+
50% 16
|
37
|
+
66% 17
|
38
|
+
75% 18
|
39
|
+
80% 18
|
40
|
+
90% 44
|
41
|
+
95% 51
|
42
|
+
98% 53
|
43
|
+
99% 55
|
44
|
+
100% 86 (longest request)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> 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: 8080
|
11
|
+
|
12
|
+
Document Path: /index2
|
13
|
+
Document Length: 42 bytes
|
14
|
+
|
15
|
+
Concurrency Level: 1
|
16
|
+
Time taken for tests: 3.794328 seconds
|
17
|
+
Complete requests: 200
|
18
|
+
Failed requests: 0
|
19
|
+
Write errors: 0
|
20
|
+
Non-2xx responses: 200
|
21
|
+
Total transferred: 41000 bytes
|
22
|
+
HTML transferred: 8400 bytes
|
23
|
+
Requests per second: 52.71 [#/sec] (mean)
|
24
|
+
Time per request: 18.972 [ms] (mean)
|
25
|
+
Time per request: 18.972 [ms] (mean, across all concurrent requests)
|
26
|
+
Transfer rate: 10.54 [Kbytes/sec] received
|
27
|
+
|
28
|
+
Connection Times (ms)
|
29
|
+
min mean[+/-sd] median max
|
30
|
+
Connect: 0 0 0.2 0 2
|
31
|
+
Processing: 12 18 10.9 14 85
|
32
|
+
Waiting: 0 16 11.4 13 83
|
33
|
+
Total: 12 18 10.9 15 85
|
34
|
+
|
35
|
+
Percentage of the requests served within a certain time (ms)
|
36
|
+
50% 15
|
37
|
+
66% 15
|
38
|
+
75% 16
|
39
|
+
80% 17
|
40
|
+
90% 43
|
41
|
+
95% 47
|
42
|
+
98% 48
|
43
|
+
99% 49
|
44
|
+
100% 85 (longest request)
|
@@ -1,23 +1,22 @@
|
|
1
|
-
# code:
|
2
1
|
# * George Moschovitis <gm@navel.gr>
|
3
|
-
#
|
4
|
-
#
|
5
|
-
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
+
# $Id: cluster.rb 234 2005-01-27 13:01:40Z gmosx $
|
4
|
+
|
5
|
+
# WARNING: This is old code, not updated to work in the
|
6
|
+
# latest nitro release. Will be fixed ASAP.
|
6
7
|
|
7
|
-
$:.unshift
|
8
|
+
$:.unshift 'lib'
|
8
9
|
|
9
|
-
require
|
10
|
-
require
|
10
|
+
require 'drb'
|
11
|
+
require 'monitor'
|
11
12
|
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
13
|
+
require 'nitro/application'
|
14
|
+
require 'nitro/server'
|
15
|
+
require 'glue/cache'
|
16
|
+
require 'nitro/server/session'
|
16
17
|
|
17
18
|
module N
|
18
19
|
|
19
|
-
# = Cluster
|
20
|
-
#
|
21
20
|
# A Cluster manages the state of a collection of servers. The cluster
|
22
21
|
# synchronizes the servers and distributes the state. An older version
|
23
22
|
# used a polling system, ie: the servers polled the cluster to
|
@@ -25,25 +24,25 @@ module N
|
|
25
24
|
# state is changed a delta is pushed to the clients.
|
26
25
|
#
|
27
26
|
# TODO: use Sync instead of Monitor
|
28
|
-
|
27
|
+
|
29
28
|
class Cluster < N::Application
|
30
29
|
|
31
|
-
# = CHash ClusterHash
|
32
|
-
#
|
33
30
|
# The CHash 'endpoint' resides in the Cluster server
|
34
|
-
|
31
|
+
|
35
32
|
class CHash < Hash
|
36
33
|
attr :mon
|
37
34
|
|
38
35
|
# drbobject for this hash (local)
|
36
|
+
|
39
37
|
attr_accessor :ldrb
|
40
38
|
|
41
39
|
# the cluster, use a cluster to implement a set
|
42
40
|
# (one server per drb_uri)
|
41
|
+
|
43
42
|
attr_accessor :cluster
|
44
43
|
|
45
44
|
#
|
46
|
-
|
45
|
+
|
47
46
|
def initialize(ldrb_uri = "druby://:8000")
|
48
47
|
@mon = Monitor.new
|
49
48
|
@ldrb = DRb.start_service(ldrb_uri, self)
|
@@ -51,7 +50,7 @@ class Cluster < N::Application
|
|
51
50
|
end
|
52
51
|
|
53
52
|
#
|
54
|
-
|
53
|
+
|
55
54
|
def join(sdrb_uri)
|
56
55
|
@mon.synchronize {
|
57
56
|
cluster[sdrb_uri] = DRbObject.new(nil, sdrb_uri)
|
@@ -61,7 +60,7 @@ class Cluster < N::Application
|
|
61
60
|
alias_method :old_set, :[]=
|
62
61
|
|
63
62
|
# Not really usefull
|
64
|
-
|
63
|
+
|
65
64
|
def []=(key, value)
|
66
65
|
# store the value (useful on server restarts)
|
67
66
|
@mon.synchronize {
|
@@ -110,10 +109,8 @@ class Cluster < N::Application
|
|
110
109
|
|
111
110
|
end
|
112
111
|
|
113
|
-
# = SHash ServerHash
|
114
|
-
#
|
115
112
|
# The SHash 'endpoint' resides in the App server
|
116
|
-
|
113
|
+
|
117
114
|
class SHash < Hash
|
118
115
|
attr :mon
|
119
116
|
|
@@ -125,7 +122,7 @@ class Cluster < N::Application
|
|
125
122
|
|
126
123
|
# ldrb = local drb uri
|
127
124
|
# cdrb = cluster drb uri
|
128
|
-
|
125
|
+
|
129
126
|
def initialize(ldrb_uri = "druby://:9000", cdrb_uri = "druby://:8000")
|
130
127
|
@mon = Monitor.new
|
131
128
|
@ldrb_uri = ldrb_uri
|
@@ -171,8 +168,8 @@ class Cluster < N::Application
|
|
171
168
|
|
172
169
|
end
|
173
170
|
|
174
|
-
#
|
175
|
-
|
171
|
+
# Cluster Last Modified Hash
|
172
|
+
|
176
173
|
class Clm < CHash
|
177
174
|
def [](key)
|
178
175
|
@mon.synchronize {
|
@@ -187,7 +184,7 @@ class Cluster < N::Application
|
|
187
184
|
end
|
188
185
|
|
189
186
|
# = Slm Server Last Modified Hash
|
190
|
-
|
187
|
+
|
191
188
|
class Slm < SHash
|
192
189
|
def set!(key, lm = nil)
|
193
190
|
lm = Time.now.to_i unless lm
|
@@ -213,10 +210,9 @@ class Cluster < N::Application
|
|
213
210
|
|
214
211
|
end
|
215
212
|
|
216
|
-
end
|
213
|
+
end
|
217
214
|
|
218
215
|
if $0 == __FILE__
|
219
|
-
require
|
220
|
-
|
216
|
+
require 'logger'
|
221
217
|
N::Cluster.new.exec()
|
222
218
|
end
|