rhoconnect 3.2.1 → 3.3.1.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +24 -5
- data/Gemfile +2 -2
- data/Gemfile.lock +20 -20
- data/bench/benchapp/Gemfile +17 -20
- data/bench/benchapp/config.ru +2 -2
- data/bench/benchapp/settings/settings.yml +3 -3
- data/bench/blobapp/Gemfile +16 -13
- data/bench/blobapp/config.ru +2 -2
- data/bench/blobapp/settings/settings.yml +5 -3
- data/bench/lib/bench.rb +35 -32
- data/bench/lib/bench/session.rb +9 -1
- data/bench/scripts/blob_cud_script.rb +13 -17
- data/bench/scripts/cud_script.rb +11 -12
- data/bench/scripts/helpers.rb +5 -7
- data/bench/scripts/query_md_script.rb +18 -12
- data/bench/scripts/query_only_script.rb +19 -11
- data/bench/scripts/query_script.rb +17 -13
- data/bench/scripts/test_query_script.rb +46 -17
- data/bench/scripts/test_source_script.rb +7 -7
- data/commands/commands/dtach_commands/dtach_install.rb +44 -16
- data/commands/commands/rhoconnect/spec.rb +13 -9
- data/commands/commands/rhoconnect/version.rb +6 -0
- data/commands/execute.rb +10 -6
- data/doc/deploying.txt +75 -13
- data/doc/install.txt +3 -3
- data/doc/push-client-setup.txt +1 -1
- data/doc/rest-api.txt +4 -23
- data/doc/rhoconnect-redis-stack.txt +26 -7
- data/doc/settings.txt +9 -3
- data/examples/simple/Gemfile +3 -1
- data/examples/simple/application.rb +5 -0
- data/examples/simple/config.ru +3 -2
- data/examples/simple/my_server.rb +14 -0
- data/examples/simple/settings/settings.yml +1 -0
- data/generators/templates/application/Gemfile +4 -4
- data/generators/templates/application/application.rb +4 -0
- data/generators/templates/application/settings/settings.yml +4 -1
- data/installer/unix-like/create_texts.rb +39 -1
- data/installer/unix-like/rho_connect_install_constants.rb +1 -1
- data/installer/utils/package_upload/repos.rake +7 -5
- data/lib/rhoconnect.rb +3 -2
- data/lib/rhoconnect/api/app/ans_login.rb +3 -0
- data/lib/rhoconnect/api/app/bulk_data.rb +6 -0
- data/lib/rhoconnect/api/{source → app}/fast_delete.rb +1 -1
- data/lib/rhoconnect/api/{source → app}/fast_insert.rb +2 -2
- data/lib/rhoconnect/api/{source → app}/fast_update.rb +2 -2
- data/lib/rhoconnect/api/app/login.rb +5 -0
- data/lib/rhoconnect/api/{source → app}/push_deletes.rb +1 -1
- data/lib/rhoconnect/api/{source → app}/push_objects.rb +1 -1
- data/lib/rhoconnect/api/app/query.rb +4 -0
- data/lib/rhoconnect/api/app/queue_updates.rb +94 -0
- data/lib/rhoconnect/api/app/search.rb +4 -0
- data/lib/rhoconnect/api/client/client_get_db_doc.rb +5 -0
- data/lib/rhoconnect/api/client/client_set_db_doc.rb +8 -0
- data/lib/rhoconnect/api/client/create.rb +7 -0
- data/lib/rhoconnect/api/client/get_client_params.rb +2 -1
- data/lib/rhoconnect/api/client/list_client_docs.rb +2 -1
- data/lib/rhoconnect/api/client/register.rb +12 -0
- data/lib/rhoconnect/api/client/reset.rb +5 -0
- data/lib/rhoconnect/api/{source → readstate}/set_refresh_time.rb +2 -1
- data/lib/rhoconnect/api/source/get_source_params.rb +3 -2
- data/lib/rhoconnect/api/source/list_sources.rb +2 -1
- data/lib/rhoconnect/api/source/update_source_params.rb +3 -3
- data/lib/rhoconnect/api/store/get_db_doc.rb +4 -0
- data/lib/rhoconnect/api/store/set_db_doc.rb +7 -0
- data/lib/rhoconnect/api/system/get_adapter.rb +4 -0
- data/lib/rhoconnect/api/{admin → system}/get_license_info.rb +2 -1
- data/lib/rhoconnect/api/system/login.rb +15 -0
- data/lib/rhoconnect/api/{admin → system}/reset.rb +3 -2
- data/lib/rhoconnect/api/system/save_adapter.rb +4 -0
- data/lib/rhoconnect/api/{admin → system}/stats.rb +2 -1
- data/lib/rhoconnect/api/user/create_user.rb +2 -2
- data/lib/rhoconnect/api/user/delete_client.rb +6 -0
- data/lib/rhoconnect/api/user/delete_user.rb +2 -1
- data/lib/rhoconnect/api/user/list_clients.rb +4 -0
- data/lib/rhoconnect/api/user/list_source_docs.rb +11 -0
- data/lib/rhoconnect/api/user/list_users.rb +1 -1
- data/lib/rhoconnect/api/user/ping.rb +7 -0
- data/lib/rhoconnect/api/user/show_user.rb +3 -0
- data/lib/rhoconnect/api/user/update_user.rb +3 -2
- data/lib/rhoconnect/api/user/user_get_db_doc.rb +5 -0
- data/lib/rhoconnect/api/user/user_set_db_doc.rb +10 -0
- data/lib/rhoconnect/app.rb +12 -2
- data/lib/rhoconnect/async.rb +6 -10
- data/lib/rhoconnect/bulk_data/bulk_data.rb +4 -4
- data/lib/rhoconnect/client.rb +10 -9
- data/lib/rhoconnect/client_sync.rb +24 -19
- data/lib/rhoconnect/document.rb +18 -4
- data/lib/rhoconnect/graph_helper.rb +4 -2
- data/lib/rhoconnect/jobs/bulk_data_job.rb +1 -1
- data/lib/rhoconnect/jobs/ping_job.rb +39 -29
- data/lib/rhoconnect/middleware/admin_user.rb +23 -0
- data/lib/rhoconnect/middleware/body_content_type_parser.rb +35 -0
- data/lib/rhoconnect/{cors.rb → middleware/cors.rb} +1 -0
- data/lib/rhoconnect/middleware/current_app.rb +16 -0
- data/lib/rhoconnect/middleware/current_request.rb +16 -0
- data/lib/rhoconnect/middleware/current_user.rb +17 -0
- data/lib/rhoconnect/middleware/helpers.rb +105 -0
- data/lib/rhoconnect/middleware/login_required.rb +22 -0
- data/lib/rhoconnect/{stats/middleware.rb → middleware/stats.rb} +5 -3
- data/lib/rhoconnect/middleware/x_domain_session_wrapper.rb +58 -0
- data/lib/rhoconnect/ping.rb +1 -0
- data/lib/rhoconnect/ping/apple.rb +18 -16
- data/lib/rhoconnect/ping/blackberry.rb +9 -9
- data/lib/rhoconnect/ping/rhoconnect_push.rb +45 -0
- data/lib/rhoconnect/server.rb +98 -91
- data/lib/rhoconnect/source.rb +5 -1
- data/lib/rhoconnect/source_sync.rb +4 -3
- data/lib/rhoconnect/stats/record.rb +15 -15
- data/lib/rhoconnect/store.rb +253 -75
- data/lib/rhoconnect/tasks.rb +3 -3
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect/web-console/controllers/admins.js +1 -14
- data/lib/rhoconnect/web-console/models/adapter.js +18 -8
- data/lib/rhoconnect/web-console/models/client.js +15 -9
- data/lib/rhoconnect/web-console/models/doc.js +7 -11
- data/lib/rhoconnect/web-console/models/session.js +5 -2
- data/lib/rhoconnect/web-console/models/source.js +55 -36
- data/lib/rhoconnect/web-console/models/user.js +20 -11
- data/lib/rhoconnect/web-console/public/backbone.js +8 -2
- data/lib/rhoconnect/web-console/templates/index.erb +11 -5
- data/lib/rhoconnect/web-console/views/doc.js +6 -8
- data/lib/rhoconnect/web-console/views/edit_user.js +6 -3
- data/lib/rhoconnect/web-console/views/home.js +98 -25
- data/lib/rhoconnect/web-console/views/index.js +1 -1
- data/lib/rhoconnect/web-console/views/new_ping.js +6 -3
- data/lib/rhoconnect/web-console/views/server_doc.js +12 -4
- data/lib/rhoconnect/web-console/views/show_device.js +6 -3
- data/rhoconnect.gemspec +1 -2
- data/spec/api/{source → app}/fast_delete_spec.rb +4 -4
- data/spec/api/{source → app}/fast_insert_spec.rb +4 -4
- data/spec/api/{source → app}/fast_update_spec.rb +22 -6
- data/spec/api/{source → app}/push_deletes_spec.rb +2 -2
- data/spec/api/app/push_objects_spec.rb +45 -0
- data/spec/api/client/client_get_db_doc_spec.rb +31 -0
- data/spec/api/client/client_set_db_doc_spec.rb +14 -0
- data/spec/api/client/get_client_params_spec.rb +3 -2
- data/spec/api/client/list_client_docs_spec.rb +2 -2
- data/spec/api/{source → readstate}/set_refresh_time_spec.rb +15 -9
- data/spec/api/source/get_source_params_spec.rb +3 -2
- data/spec/api/source/list_sources_spec.rb +3 -9
- data/spec/api/source/update_source_params_spec.rb +4 -4
- data/spec/api/store/get_db_doc_spec.rb +32 -0
- data/spec/api/store/set_db_doc_spec.rb +43 -0
- data/spec/api/system/adapter_spec.rb +33 -0
- data/spec/api/{admin → system}/get_license_info_spec.rb +2 -5
- data/spec/api/{admin/get_api_token_spec.rb → system/login_spec.rb} +4 -11
- data/spec/api/{admin → system}/reset_spec.rb +2 -2
- data/spec/api/{admin → system}/stats_spec.rb +19 -13
- data/spec/api/user/create_user_spec.rb +15 -8
- data/spec/api/{client → user}/delete_client_spec.rb +3 -4
- data/spec/api/user/delete_user_spec.rb +33 -4
- data/spec/api/user/list_clients_spec.rb +30 -0
- data/spec/api/user/list_source_docs_spec.rb +35 -0
- data/spec/api/user/list_users_spec.rb +5 -6
- data/spec/api/{client → user}/ping_spec.rb +4 -6
- data/spec/api/user/show_user_spec.rb +14 -0
- data/spec/api/user/update_user_spec.rb +28 -10
- data/spec/api/user/user_get_db_doc_spec.rb +16 -0
- data/spec/api/user/user_set_db_doc_spec.rb +41 -0
- data/spec/apps/rhotestapp/application.rb +4 -0
- data/spec/apps/rhotestapp/settings/settings.yml +3 -1
- data/spec/bulk_data/bulk_data_spec.rb +13 -0
- data/spec/client_sync_spec.rb +41 -59
- data/spec/document_spec.rb +23 -0
- data/spec/javascripts/doc_view_spec.js +1 -1
- data/spec/javascripts/home_view_spec.js +10 -5
- data/spec/javascripts/index_view_spec.js +1 -1
- data/spec/jobs/ping_job_spec.rb +26 -0
- data/spec/perf/store_perf_spec.rb +1 -1
- data/spec/ping/android_spec.rb +0 -7
- data/spec/ping/apple_spec.rb +7 -0
- data/spec/ping/blackberry_spec.rb +10 -0
- data/spec/ping/rhoconnect_push_spec.rb +58 -0
- data/spec/server/cors_spec.rb +1 -1
- data/spec/server/server_spec.rb +152 -104
- data/spec/{stats/middleware_spec.rb → server/stats_spec.rb} +4 -5
- data/spec/server/x_domain_session_wrapper_spec.rb +3 -3
- data/spec/source_spec.rb +2 -2
- data/spec/source_sync_spec.rb +2 -0
- data/spec/spec_helper.rb +17 -3
- data/spec/stats/record_spec.rb +18 -19
- data/spec/store_spec.rb +51 -26
- data/spec/support/shared_examples.rb +4 -0
- data/spec/sync_states_spec.rb +2 -2
- metadata +104 -88
- data/bench/benchapp/Gemfile.lock +0 -87
- data/bench/blobapp/Gemfile.lock +0 -107
- data/bench/lib/testdata/5-data.txt +0 -8
- data/doc/release.txt +0 -41
- data/lib/rhoconnect/api/admin/get_api_token.rb +0 -14
- data/lib/rhoconnect/api/admin/login.rb +0 -6
- data/lib/rhoconnect/api/application/bulk_data.rb +0 -7
- data/lib/rhoconnect/api/application/clientcreate.rb +0 -8
- data/lib/rhoconnect/api/application/clientlogin.rb +0 -6
- data/lib/rhoconnect/api/application/clientregister.rb +0 -13
- data/lib/rhoconnect/api/application/clientreset.rb +0 -6
- data/lib/rhoconnect/api/application/query.rb +0 -7
- data/lib/rhoconnect/api/application/queue_updates.rb +0 -20
- data/lib/rhoconnect/api/application/search.rb +0 -6
- data/lib/rhoconnect/api/client/create_client.rb +0 -3
- data/lib/rhoconnect/api/client/delete_client.rb +0 -5
- data/lib/rhoconnect/api/client/list_clients.rb +0 -3
- data/lib/rhoconnect/api/client/ping.rb +0 -7
- data/lib/rhoconnect/api/source/get_adapter.rb +0 -3
- data/lib/rhoconnect/api/source/get_db_doc.rb +0 -7
- data/lib/rhoconnect/api/source/list_source_docs.rb +0 -10
- data/lib/rhoconnect/api/source/save_adapter.rb +0 -3
- data/lib/rhoconnect/api/source/set_db_doc.rb +0 -10
- data/lib/rhoconnect/api/source/upload_file.rb +0 -4
- data/lib/rhoconnect/body_content_type_parser.rb +0 -32
- data/lib/rhoconnect/x_domain_session_wrapper.rb +0 -53
- data/spec/api/admin/api_token_spec.rb +0 -13
- data/spec/api/client/create_client_spec.rb +0 -13
- data/spec/api/client/list_clients_spec.rb +0 -22
- data/spec/api/source/adapter_spec.rb +0 -29
- data/spec/api/source/get_db_doc_spec.rb +0 -21
- data/spec/api/source/list_source_docs_spec.rb +0 -25
- data/spec/api/source/push_objects_spec.rb +0 -27
- data/spec/api/source/set_db_doc_spec.rb +0 -32
- data/spec/api/source/upload_file_spec.rb +0 -26
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,27 @@
|
|
1
|
-
## 3.
|
2
|
-
* #
|
3
|
-
|
4
|
-
|
5
|
-
* #
|
1
|
+
## 3.3.1.beta2 (2012-07-09
|
2
|
+
* #29806209 - Store re-design - implement persistent hashing
|
3
|
+
* #32389009 - Store re-design - optimize sync by computing diffs only for the requested number of objects (as specified by page_size)
|
4
|
+
* #26876157 - push: auth route added `/ans/login`
|
5
|
+
* #26892609 - push: queue support
|
6
|
+
* #31863031 - push: handle token post `device_push_type` attribute
|
7
|
+
* #32483159 - update web console to use RC v1 routes
|
8
|
+
|
9
|
+
## 3.3.1.beta1 (2012-06-29)
|
10
|
+
* #29796429 - use list to preserve bulk data sources order
|
11
|
+
* #29743645 - do not execute ping when platform is not configured
|
12
|
+
* #27198669 - REST API routes
|
13
|
+
* #27422451 - Create middleware to extract API token, current user, etc.
|
14
|
+
* #27198831 - Move API_TOKEN from params into the header
|
15
|
+
* #27198869 - Move CLIENT_ID from params into the header
|
16
|
+
* #30760809 - Bug move appserver to redis from memory and config settings
|
17
|
+
* #30732533 - dtach-install command fails
|
18
|
+
* Added `version` command to print current version
|
19
|
+
* #31161737 - PingJob handles missing user ids or users with no clients
|
20
|
+
* #31245585 - blob_attribs in bulk database missing overwrite flag
|
21
|
+
|
22
|
+
## 3.2.1 (2012-06-22)
|
23
|
+
* #30760809 - Bug move appserver to redis from memory and config settings
|
24
|
+
* #27555029 - support REDISTOGO_URL in addition to REDIS env vars as redis connection strings
|
6
25
|
|
7
26
|
## 3.2.0.final (2012-05-15)
|
8
27
|
* Release candidate
|
data/Gemfile
CHANGED
@@ -37,7 +37,7 @@ group :development do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
group :test do
|
40
|
-
gem 'rspec', '~> 2.
|
40
|
+
gem 'rspec', '~> 2.10.0'
|
41
41
|
gem "rcov", '~> 1.0.0', :require => false, :platforms => :ruby_18
|
42
42
|
gem 'simplecov', :require => false, :platforms => [:ruby_19,:jruby]
|
43
43
|
gem 'rack-test', '>= 0.5.3', :require => 'rack/test'
|
@@ -46,5 +46,5 @@ group :test do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
group :build do
|
49
|
-
gem 'fpm', '>= 0.4.
|
49
|
+
gem 'fpm', '>= 0.4.9'
|
50
50
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rhoconnect (3.
|
4
|
+
rhoconnect (3.3.1.beta2)
|
5
5
|
bundler (~> 1.0)
|
6
6
|
json (~> 1.6.0)
|
7
7
|
rake (~> 0.9.2)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
rubyzip (~> 0.9.4)
|
12
12
|
sinatra (~> 1.3)
|
13
13
|
templater (~> 1.0.0)
|
14
|
-
thor (~> 0.
|
14
|
+
thor (~> 0.15.0)
|
15
15
|
uuidtools (>= 2.1.1)
|
16
16
|
|
17
17
|
GEM
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
builder (3.0.0)
|
32
32
|
cabin (0.4.4)
|
33
33
|
json
|
34
|
-
childprocess (0.3.
|
34
|
+
childprocess (0.3.3)
|
35
35
|
ffi (~> 1.0.6)
|
36
36
|
clamp (0.3.1)
|
37
37
|
coffee-script (2.2.0)
|
@@ -41,16 +41,16 @@ GEM
|
|
41
41
|
crack (0.3.1)
|
42
42
|
daemons (1.1.8)
|
43
43
|
diff-lcs (1.1.3)
|
44
|
-
eventmachine (1.0.0.rc.
|
45
|
-
excon (0.
|
44
|
+
eventmachine (1.0.0.rc.4)
|
45
|
+
excon (0.14.3)
|
46
46
|
execjs (1.4.0)
|
47
47
|
multi_json (~> 1.0)
|
48
48
|
extlib (0.9.15)
|
49
49
|
ffaker (1.14.0)
|
50
50
|
ffi (1.0.11)
|
51
|
-
fog (1.
|
51
|
+
fog (1.4.0)
|
52
52
|
builder
|
53
|
-
excon (~> 0.
|
53
|
+
excon (~> 0.14.0)
|
54
54
|
formatador (~> 0.2.0)
|
55
55
|
mime-types
|
56
56
|
multi_json (~> 1.0)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
net-scp (1.0.4)
|
88
88
|
net-ssh (>= 1.99.1)
|
89
89
|
net-ssh (2.5.2)
|
90
|
-
nokogiri (1.5.
|
90
|
+
nokogiri (1.5.5)
|
91
91
|
rack (1.4.1)
|
92
92
|
rack-fiber_pool (0.9.2)
|
93
93
|
rack-protection (1.2.0)
|
@@ -107,14 +107,14 @@ GEM
|
|
107
107
|
vegas (~> 0.1.2)
|
108
108
|
rest-client (1.6.7)
|
109
109
|
mime-types (>= 1.16)
|
110
|
-
rspec (2.
|
111
|
-
rspec-core (~> 2.
|
112
|
-
rspec-expectations (~> 2.
|
113
|
-
rspec-mocks (~> 2.
|
114
|
-
rspec-core (2.
|
115
|
-
rspec-expectations (2.
|
110
|
+
rspec (2.10.0)
|
111
|
+
rspec-core (~> 2.10.0)
|
112
|
+
rspec-expectations (~> 2.10.0)
|
113
|
+
rspec-mocks (~> 2.10.0)
|
114
|
+
rspec-core (2.10.0)
|
115
|
+
rspec-expectations (2.10.0)
|
116
116
|
diff-lcs (~> 1.1.3)
|
117
|
-
rspec-mocks (2.
|
117
|
+
rspec-mocks (2.10.1)
|
118
118
|
ruby-hmac (0.4.0)
|
119
119
|
rubyzip (0.9.9)
|
120
120
|
selenium-webdriver (2.24.0)
|
@@ -130,7 +130,7 @@ GEM
|
|
130
130
|
rack (~> 1.3, >= 1.3.6)
|
131
131
|
rack-protection (~> 1.2)
|
132
132
|
tilt (~> 1.3, >= 1.3.3)
|
133
|
-
sprockets (2.4.
|
133
|
+
sprockets (2.4.4)
|
134
134
|
hike (~> 1.2)
|
135
135
|
multi_json (~> 1.0)
|
136
136
|
rack (~> 1.0)
|
@@ -140,11 +140,11 @@ GEM
|
|
140
140
|
diff-lcs (>= 1.1.2)
|
141
141
|
extlib (>= 0.9.5)
|
142
142
|
highline (>= 1.4.0)
|
143
|
-
thin (1.
|
143
|
+
thin (1.4.1)
|
144
144
|
daemons (>= 1.0.9)
|
145
145
|
eventmachine (>= 0.12.6)
|
146
146
|
rack (>= 1.0.0)
|
147
|
-
thor (0.
|
147
|
+
thor (0.15.4)
|
148
148
|
tilt (1.3.3)
|
149
149
|
uuidtools (2.1.2)
|
150
150
|
vegas (0.1.11)
|
@@ -166,7 +166,7 @@ DEPENDENCIES
|
|
166
166
|
eventmachine (~> 1.0.0.beta)
|
167
167
|
ffaker (~> 1.14.0)
|
168
168
|
fog (>= 1.1.0)
|
169
|
-
fpm (>= 0.4.
|
169
|
+
fpm (>= 0.4.9)
|
170
170
|
jasmine
|
171
171
|
jasmine-headless-webkit
|
172
172
|
jdbc-sqlite3 (>= 3.7.2)
|
@@ -175,7 +175,7 @@ DEPENDENCIES
|
|
175
175
|
rack-test (>= 0.5.3)
|
176
176
|
rcov (~> 1.0.0)
|
177
177
|
rhoconnect!
|
178
|
-
rspec (~> 2.
|
178
|
+
rspec (~> 2.10.0)
|
179
179
|
simplecov
|
180
180
|
sqlite3 (>= 1.3.3)
|
181
181
|
thin
|
data/bench/benchapp/Gemfile
CHANGED
@@ -1,35 +1,32 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rhoconnect',
|
3
|
+
gem 'rhoconnect', :path => '../../'
|
4
4
|
|
5
5
|
# Helps with some of the limitations of green threads, not needed in ruby 1.9.x
|
6
6
|
gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
|
7
|
+
gem 'win32-process', :platforms => [:mswin, :mingw]
|
8
|
+
|
9
|
+
# use thin and eventmachine everywhere except JRuby
|
10
|
+
platforms :ruby, :ruby_19, :mingw, :mingw_19 do
|
11
|
+
gem "eventmachine", "~> 1.0.0.beta"
|
12
|
+
# using thin by default
|
13
|
+
gem 'thin'
|
14
|
+
end
|
15
|
+
|
16
|
+
# for async framework
|
17
|
+
# for Async, Eventful execution
|
18
|
+
platforms :ruby_19, :mingw_19 do
|
19
|
+
gem 'rack-fiber_pool'
|
20
|
+
gem 'async-rack'
|
21
|
+
end
|
7
22
|
|
8
23
|
platforms :jruby do
|
9
24
|
gem 'jdbc-sqlite3', ">= 3.7.2"
|
10
25
|
gem 'dbi', ">= 0.4.5"
|
11
26
|
gem 'dbd-jdbc', ">= 0.1.4"
|
12
27
|
gem 'jruby-openssl', ">= 0.7.4"
|
28
|
+
gem 'trinidad'
|
13
29
|
gem 'warbler'
|
14
30
|
end
|
15
31
|
|
16
32
|
gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
|
17
|
-
|
18
|
-
# For jruby trinidad JRuby web server is used
|
19
|
-
gem 'trinidad', :platforms => :jruby
|
20
|
-
|
21
|
-
group :development do
|
22
|
-
# By default to run application thin web server is used
|
23
|
-
gem 'thin', :platforms => [:ruby, :mswin, :mingw]
|
24
|
-
end
|
25
|
-
|
26
|
-
group :test do
|
27
|
-
gem 'rack-test', '>= 0.5.3', :require => "rack/test"
|
28
|
-
gem 'rspec', '~> 2.6.0'
|
29
|
-
end
|
30
|
-
|
31
|
-
# for Async, Eventful execution
|
32
|
-
platforms :ruby_19 do
|
33
|
-
gem 'rack-fiber_pool'
|
34
|
-
gem 'async-rack'
|
35
|
-
end
|
data/bench/benchapp/config.ru
CHANGED
@@ -6,10 +6,10 @@ Bundler.require
|
|
6
6
|
# Try to load vendor-ed rhoconnect, otherwise load the gem
|
7
7
|
begin
|
8
8
|
require 'vendor/rhoconnect/lib/rhoconnect/server'
|
9
|
-
require 'vendor/rhoconnect/lib/rhoconnect/console/server'
|
9
|
+
require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
|
10
10
|
rescue LoadError
|
11
11
|
require 'rhoconnect/server'
|
12
|
-
require 'rhoconnect/console/server'
|
12
|
+
require 'rhoconnect/web-console/server'
|
13
13
|
end
|
14
14
|
|
15
15
|
# By default, turn on the resque web console
|
@@ -7,16 +7,16 @@
|
|
7
7
|
:poll_interval: 300
|
8
8
|
|
9
9
|
:test:
|
10
|
-
:syncserver: http://localhost:9292/
|
10
|
+
:syncserver: http://localhost:9292/application/
|
11
11
|
:licensefile: settings/license.key
|
12
12
|
:redis: localhost:6379
|
13
13
|
:log_disabled: true
|
14
14
|
:development:
|
15
|
-
:syncserver: http://localhost:9292/
|
15
|
+
:syncserver: http://localhost:9292/application/
|
16
16
|
:licensefile: settings/license.key
|
17
17
|
:redis: localhost:6379
|
18
18
|
:log_disabled: true
|
19
19
|
:production:
|
20
|
-
:syncserver: http://localhost:9292/
|
20
|
+
:syncserver: http://localhost:9292/application/
|
21
21
|
:licensefile: settings/license.key
|
22
22
|
:redis: localhost:6379
|
data/bench/blobapp/Gemfile
CHANGED
@@ -4,26 +4,29 @@ gem 'rhoconnect', :path => '../../'
|
|
4
4
|
|
5
5
|
# Helps with some of the limitations of green threads, not needed in ruby 1.9.x
|
6
6
|
gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
|
7
|
+
gem 'win32-process', :platforms => [:mswin, :mingw]
|
8
|
+
|
9
|
+
# use thin and eventmachine everywhere except JRuby
|
10
|
+
platforms :ruby, :ruby_19, :mingw, :mingw_19 do
|
11
|
+
gem "eventmachine", "~> 1.0.0.beta"
|
12
|
+
# using thin by default
|
13
|
+
gem 'thin'
|
14
|
+
end
|
15
|
+
|
16
|
+
# for async framework
|
17
|
+
# for Async, Eventful execution
|
18
|
+
platforms :ruby_19, :mingw_19 do
|
19
|
+
gem 'rack-fiber_pool'
|
20
|
+
gem 'async-rack'
|
21
|
+
end
|
7
22
|
|
8
23
|
platforms :jruby do
|
9
24
|
gem 'jdbc-sqlite3', ">= 3.7.2"
|
10
25
|
gem 'dbi', ">= 0.4.5"
|
11
26
|
gem 'dbd-jdbc', ">= 0.1.4"
|
12
27
|
gem 'jruby-openssl', ">= 0.7.4"
|
28
|
+
gem 'trinidad'
|
13
29
|
gem 'warbler'
|
14
30
|
end
|
15
31
|
|
16
32
|
gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
|
17
|
-
|
18
|
-
# For jruby trinidad JRuby web server is used
|
19
|
-
gem 'trinidad', :platforms => :jruby
|
20
|
-
|
21
|
-
group :development do
|
22
|
-
# By default to run application thin web server is used
|
23
|
-
gem 'thin', :platforms => [:ruby, :mswin, :mingw]
|
24
|
-
end
|
25
|
-
|
26
|
-
group :test do
|
27
|
-
gem 'rack-test', '>= 0.5.3', :require => "rack/test"
|
28
|
-
gem 'rspec', '~> 2.6.0'
|
29
|
-
end
|
data/bench/blobapp/config.ru
CHANGED
@@ -6,10 +6,10 @@ Bundler.require
|
|
6
6
|
# Try to load vendor-ed rhoconnect, otherwise load the gem
|
7
7
|
begin
|
8
8
|
require 'vendor/rhoconnect/lib/rhoconnect/server'
|
9
|
-
require 'vendor/rhoconnect/lib/rhoconnect/console/server'
|
9
|
+
require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
|
10
10
|
rescue LoadError
|
11
11
|
require 'rhoconnect/server'
|
12
|
-
require 'rhoconnect/console/server'
|
12
|
+
require 'rhoconnect/web-console/server'
|
13
13
|
end
|
14
14
|
|
15
15
|
# By default, turn on the resque web console
|
@@ -1,16 +1,18 @@
|
|
1
|
+
#Sources
|
1
2
|
:sources:
|
2
3
|
BlobAdapter:
|
3
4
|
:poll_interval: 300
|
4
5
|
|
5
6
|
:test:
|
6
7
|
:redis: localhost:6379
|
7
|
-
:syncserver: http://localhost:9292/
|
8
|
+
:syncserver: http://localhost:9292/application/
|
8
9
|
:licensefile: settings/license.key
|
9
10
|
:development:
|
10
11
|
:redis: localhost:6379
|
11
|
-
:syncserver: http://localhost:9292/
|
12
|
+
:syncserver: http://localhost:9292/application/
|
12
13
|
:licensefile: settings/license.key
|
14
|
+
:log_disabled: true
|
13
15
|
:production:
|
14
16
|
:redis: localhost:6379
|
15
|
-
:syncserver: http://localhost:9292/
|
17
|
+
:syncserver: http://localhost:9292/application/
|
16
18
|
:licensefile: settings/license.key
|
data/bench/lib/bench.rb
CHANGED
@@ -56,71 +56,74 @@ module Bench
|
|
56
56
|
|
57
57
|
def get_server_license_info
|
58
58
|
token = get_token
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
@body = RestClient.get(
|
60
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/system/license",
|
61
|
+
{'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
|
62
62
|
JSON.parse(@body.to_s)
|
63
63
|
end
|
64
64
|
|
65
65
|
def get_server_state(doc)
|
66
66
|
token = get_token
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
@body = RestClient.get(
|
68
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
|
69
|
+
{'X-RhoConnect-API-TOKEN' => token})
|
70
70
|
JSON.parse(@body.to_s)
|
71
71
|
end
|
72
72
|
|
73
73
|
def get_server_value(doc)
|
74
74
|
token = get_token
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
@body = RestClient.get(
|
76
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
|
77
|
+
{'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
|
78
78
|
end
|
79
79
|
|
80
80
|
def reset_app
|
81
|
-
RestClient.post(
|
81
|
+
RestClient.post(
|
82
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/system/reset",
|
83
|
+
{},
|
84
|
+
{:content_type => :json, 'X-RhoConnect-API-TOKEN' => get_token})
|
82
85
|
end
|
83
86
|
|
84
87
|
def create_user(user_name, password)
|
85
88
|
token = get_token
|
86
|
-
RestClient.post(
|
87
|
-
{
|
88
|
-
|
89
|
-
|
89
|
+
RestClient.post(
|
90
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/users",
|
91
|
+
{:app_name => @app_name, :attributes => {:login => user_name, :password => password}}.to_json,
|
92
|
+
{:content_type => :json, 'X-RhoConnect-API-TOKEN' => token})
|
90
93
|
end
|
91
94
|
|
92
95
|
def set_server_state(doc,data,append=false)
|
93
96
|
token = get_token
|
94
|
-
params = {:
|
95
|
-
if data.is_a? String
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
97
|
+
params = {:data => data, :append => append}
|
98
|
+
params[:data_type] = 'string' if data.is_a? String
|
99
|
+
RestClient.post(
|
100
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
|
101
|
+
params.to_json,
|
102
|
+
{'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
|
100
103
|
end
|
101
104
|
|
102
105
|
def reset_refresh_time(source_name,poll_interval=nil)
|
103
106
|
token = get_token
|
104
|
-
RestClient.
|
105
|
-
{
|
106
|
-
|
107
|
-
|
108
|
-
:content_type => :json)
|
107
|
+
RestClient.put(
|
108
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/readstate/users/#{@user_name}/sources/#{source_name}",
|
109
|
+
{:poll_interval => poll_interval}.to_json,
|
110
|
+
{'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
|
109
111
|
end
|
110
112
|
|
111
113
|
def set_simulate_time(source_name,simulate_time=0)
|
112
114
|
token = get_token
|
113
|
-
RestClient.
|
114
|
-
{
|
115
|
-
|
116
|
-
|
117
|
-
:content_type => :json)
|
115
|
+
RestClient.put(
|
116
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/sources/#{source_name}",
|
117
|
+
{:data => {:simulate_time => simulate_time}}.to_json,
|
118
|
+
{'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
|
118
119
|
end
|
119
120
|
|
120
121
|
def get_token
|
121
122
|
unless @token
|
122
|
-
@token = RestClient.post(
|
123
|
-
{
|
123
|
+
@token = RestClient.post(
|
124
|
+
"#{@host}/rc/#{Rhoconnect::API_VERSION}/system/login",
|
125
|
+
{:login => @admin_login, :password => @admin_password}.to_json,
|
126
|
+
:content_type => :json)
|
124
127
|
end
|
125
128
|
@token
|
126
129
|
end
|
data/bench/lib/bench/session.rb
CHANGED
@@ -11,7 +11,7 @@ module Bench
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def post(marker,url,headers={})
|
14
|
-
@body = yield
|
14
|
+
@body = yield if block_given?
|
15
15
|
_request(marker,:_post,url,headers)
|
16
16
|
end
|
17
17
|
|
@@ -22,6 +22,10 @@ module Bench
|
|
22
22
|
_request(marker,:_get,url_params,headers)
|
23
23
|
end
|
24
24
|
|
25
|
+
def delete(marker,url,headers={})
|
26
|
+
_request(marker,:_delete,url,headers)
|
27
|
+
end
|
28
|
+
|
25
29
|
protected
|
26
30
|
def _request(marker,verb,url,headers)
|
27
31
|
result = Result.new(marker,verb,url,@thread_id,@iteration)
|
@@ -58,6 +62,10 @@ module Bench
|
|
58
62
|
RestClient.post(url, @body, headers)
|
59
63
|
end
|
60
64
|
|
65
|
+
def _delete(url,headers)
|
66
|
+
RestClient.delete(url, headers)
|
67
|
+
end
|
68
|
+
|
61
69
|
def _url_params(params)
|
62
70
|
elements = []
|
63
71
|
params.each do |key,value|
|