data_fabric 1.2.5 → 1.2.7
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/CHANGELOG +10 -0
- data/README.rdoc +1 -0
- data/Rakefile +13 -11
- data/{example22 → example23}/Rakefile +0 -0
- data/{example22 → example23}/app/controllers/accounts_controller.rb +0 -0
- data/{example22/app/controllers/application.rb → example23/app/controllers/application_controller.rb} +0 -0
- data/{example22 → example23}/app/controllers/figments_controller.rb +0 -0
- data/{example22 → example23}/app/helpers/application_helper.rb +0 -0
- data/{example22 → example23}/app/models/account.rb +0 -0
- data/{example22 → example23}/app/models/figment.rb +0 -0
- data/{example22 → example23}/app/views/accounts/index.html.erb +0 -0
- data/{example22 → example23}/app/views/layouts/application.html.erb +0 -0
- data/{example22 → example23}/config/boot.rb +0 -0
- data/{example22 → example23}/config/database.yml +0 -0
- data/{example22 → example23}/config/environment.rb +2 -2
- data/{example22 → example23}/config/environments/development.rb +0 -0
- data/{example22 → example23}/config/environments/production.rb +0 -0
- data/{example22 → example23}/config/environments/test.rb +0 -0
- data/{example22 → example23}/config/initializers/inflections.rb +0 -0
- data/{example22 → example23}/config/initializers/mime_types.rb +0 -0
- data/{example22 → example23}/config/initializers/new_rails_defaults.rb +0 -0
- data/{example22 → example23}/config/locales/en.yml +0 -0
- data/{example22 → example23}/config/routes.rb +0 -0
- data/example23/db/development.sqlite3 +0 -0
- data/{example22 → example23}/db/migrate/20080702154628_create_accounts.rb +0 -0
- data/{example22 → example23}/db/migrate/20080702154820_create_figments.rb +0 -0
- data/example23/db/s0_development.sqlite3 +0 -0
- data/example23/db/s0_test.sqlite3 +0 -0
- data/example23/db/s1_development.sqlite3 +0 -0
- data/example23/db/s1_test.sqlite3 +0 -0
- data/example23/db/schema.rb +28 -0
- data/example23/db/test.sqlite3 +0 -0
- data/example23/log/development.log +295 -0
- data/example23/log/test.log +551 -0
- data/{example22 → example23}/public/404.html +0 -0
- data/{example22 → example23}/public/422.html +0 -0
- data/{example22 → example23}/public/500.html +0 -0
- data/{example22 → example23}/public/dispatch.cgi +0 -0
- data/{example22 → example23}/public/dispatch.fcgi +0 -0
- data/{example22 → example23}/public/dispatch.rb +0 -0
- data/{example22 → example23}/public/favicon.ico +0 -0
- data/{example22 → example23}/public/images/rails.png +0 -0
- data/{example22 → example23}/public/index.html +0 -0
- data/{example22 → example23}/public/robots.txt +0 -0
- data/{example22 → example23}/script/about +0 -0
- data/{example22 → example23}/script/console +0 -0
- data/{example22 → example23}/script/dbconsole +0 -0
- data/{example22 → example23}/script/destroy +0 -0
- data/{example22 → example23}/script/generate +0 -0
- data/{example22 → example23}/script/performance/benchmarker +0 -0
- data/{example22 → example23}/script/performance/profiler +0 -0
- data/{example22 → example23}/script/performance/request +0 -0
- data/{example22 → example23}/script/plugin +0 -0
- data/{example22 → example23}/script/process/inspector +0 -0
- data/{example22 → example23}/script/process/reaper +0 -0
- data/{example22 → example23}/script/process/spawner +0 -0
- data/{example22 → example23}/script/runner +0 -0
- data/{example22 → example23}/script/server +0 -0
- data/{example22 → example23}/test/fixtures/accounts.yml +0 -0
- data/{example22 → example23}/test/functional/accounts_controller_test.rb +0 -0
- data/{example22 → example23}/test/integration/account_figments_test.rb +0 -0
- data/{example22 → example23}/test/performance/browsing_test.rb +0 -0
- data/example23/test/test_helper.rb +3 -0
- data/example23/vendor/plugins/data_fabric/init.rb +3 -0
- data/example23/vendor/plugins/data_fabric/lib/data_fabric.rb +106 -0
- data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb +133 -0
- data/example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb +181 -0
- data/example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb +20 -0
- data/example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb +7 -0
- data/lib/data_fabric/ar22.rb +2 -2
- data/lib/data_fabric/version.rb +1 -6
- data/test/connection_test.rb +1 -1
- data/test/database_test.rb +1 -1
- data/test/shard_test.rb +1 -1
- data/test/thread_test.rb +1 -1
- metadata +134 -126
- data/VERSION.yml +0 -4
- data/example22/test/test_helper.rb +0 -38
@@ -0,0 +1,20 @@
|
|
1
|
+
# A data_fabric recipe for use with the FiveRuns Dash metrics service at
|
2
|
+
# http://dash.fiveruns.com.
|
3
|
+
#
|
4
|
+
# Hook into your Rails application by adding the recipe in your
|
5
|
+
# config/initializers/dash.rb, like so:
|
6
|
+
#
|
7
|
+
# require 'data_fabric/dash'
|
8
|
+
# Fiveruns::Dash::Rails.start :production => 'your-token' do |config|
|
9
|
+
# config.add_recipe :data_fabric, :url => 'http://mikeperham.com'
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
raise ArgumentError, "The Dash recipe for DataFabric is only supported on ActiveRecord 2.2 and greater" if ActiveRecord::VERSION::STRING < '2.2.0'
|
13
|
+
|
14
|
+
Fiveruns::Dash.register_recipe :data_fabric, :url => 'http://mikeperham.com' do |recipe|
|
15
|
+
recipe.absolute :open_connections, 'Open Connections' do
|
16
|
+
DataFabric::ConnectionProxy.shard_pools.values.map do |pool|
|
17
|
+
(pool.instance_variable_get(:@checked_out) || []).size
|
18
|
+
end.sum
|
19
|
+
end
|
20
|
+
end
|
data/lib/data_fabric/ar22.rb
CHANGED
data/lib/data_fabric/version.rb
CHANGED
data/test/connection_test.rb
CHANGED
data/test/database_test.rb
CHANGED
data/test/shard_test.rb
CHANGED
data/test/thread_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_fabric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 2
|
8
|
+
- 7
|
9
|
+
version: 1.2.7
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Mike Perham
|
@@ -9,10 +14,35 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-08-10 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: jeweler
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :development
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: flexmock
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
type: :development
|
45
|
+
version_requirements: *id002
|
16
46
|
description:
|
17
47
|
email: mperham@gmail.com
|
18
48
|
executables: []
|
@@ -22,62 +52,34 @@ extensions: []
|
|
22
52
|
extra_rdoc_files:
|
23
53
|
- README.rdoc
|
24
54
|
files:
|
55
|
+
- CHANGELOG
|
25
56
|
- README.rdoc
|
26
|
-
- TESTING.rdoc
|
27
57
|
- Rakefile
|
28
|
-
-
|
29
|
-
-
|
30
|
-
- CHANGELOG
|
31
|
-
- lib/data_fabric
|
32
|
-
- lib/data_fabric/ar20.rb
|
33
|
-
- lib/data_fabric/ar22.rb
|
34
|
-
- lib/data_fabric/dash.rb
|
35
|
-
- lib/data_fabric/version.rb
|
36
|
-
- lib/data_fabric.rb
|
37
|
-
- test/connection_test.rb
|
38
|
-
- test/database.yml
|
39
|
-
- test/database.yml.mysql
|
40
|
-
- test/database_test.rb
|
41
|
-
- test/shard_test.rb
|
42
|
-
- test/test_helper.rb
|
43
|
-
- test/thread_test.rb
|
44
|
-
- rails/init.rb
|
45
|
-
- example/app
|
46
|
-
- example/app/controllers
|
58
|
+
- TESTING.rdoc
|
59
|
+
- example/Rakefile
|
47
60
|
- example/app/controllers/accounts_controller.rb
|
48
61
|
- example/app/controllers/application.rb
|
49
62
|
- example/app/controllers/figments_controller.rb
|
50
|
-
- example/app/helpers
|
51
63
|
- example/app/helpers/accounts_helper.rb
|
52
64
|
- example/app/helpers/application_helper.rb
|
53
65
|
- example/app/helpers/figments_helper.rb
|
54
|
-
- example/app/models
|
55
66
|
- example/app/models/account.rb
|
56
67
|
- example/app/models/figment.rb
|
57
|
-
- example/app/views
|
58
|
-
- example/app/views/accounts
|
59
68
|
- example/app/views/accounts/index.html.erb
|
60
|
-
- example/app/views/layouts
|
61
69
|
- example/app/views/layouts/application.html.erb
|
62
|
-
- example/config
|
63
70
|
- example/config/boot.rb
|
64
71
|
- example/config/database.yml
|
65
72
|
- example/config/environment.rb
|
66
|
-
- example/config/environments
|
67
73
|
- example/config/environments/development.rb
|
68
74
|
- example/config/environments/production.rb
|
69
75
|
- example/config/environments/test.rb
|
70
|
-
- example/config/initializers
|
71
76
|
- example/config/initializers/inflections.rb
|
72
77
|
- example/config/initializers/mime_types.rb
|
73
78
|
- example/config/initializers/new_rails_defaults.rb
|
74
79
|
- example/config/routes.rb
|
75
|
-
- example/db
|
76
|
-
- example/db/migrate
|
77
80
|
- example/db/migrate/20080702154628_create_accounts.rb
|
78
81
|
- example/db/migrate/20080702154820_create_figments.rb
|
79
82
|
- example/db/schema.rb
|
80
|
-
- example/public
|
81
83
|
- example/public/404.html
|
82
84
|
- example/public/422.html
|
83
85
|
- example/public/500.html
|
@@ -85,135 +87,141 @@ files:
|
|
85
87
|
- example/public/dispatch.fcgi
|
86
88
|
- example/public/dispatch.rb
|
87
89
|
- example/public/favicon.ico
|
88
|
-
- example/public/images
|
89
90
|
- example/public/images/rails.png
|
90
91
|
- example/public/robots.txt
|
91
|
-
- example/Rakefile
|
92
|
-
- example/script
|
93
92
|
- example/script/about
|
94
93
|
- example/script/console
|
95
94
|
- example/script/dbconsole
|
96
95
|
- example/script/destroy
|
97
96
|
- example/script/generate
|
98
|
-
- example/script/performance
|
99
97
|
- example/script/performance/benchmarker
|
100
98
|
- example/script/performance/profiler
|
101
99
|
- example/script/performance/request
|
102
100
|
- example/script/plugin
|
103
|
-
- example/script/process
|
104
101
|
- example/script/process/inspector
|
105
102
|
- example/script/process/reaper
|
106
103
|
- example/script/process/spawner
|
107
104
|
- example/script/runner
|
108
105
|
- example/script/server
|
109
|
-
- example/test
|
110
|
-
- example/test/fixtures
|
111
106
|
- example/test/fixtures/accounts.yml
|
112
|
-
- example/test/functional
|
113
107
|
- example/test/functional/accounts_controller_test.rb
|
114
|
-
- example/test/integration
|
115
108
|
- example/test/integration/account_figments_test.rb
|
116
109
|
- example/test/test_helper.rb
|
117
|
-
-
|
118
|
-
-
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
151
|
-
-
|
152
|
-
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
159
|
-
-
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
183
|
-
-
|
184
|
-
-
|
185
|
-
-
|
186
|
-
-
|
187
|
-
-
|
188
|
-
-
|
189
|
-
-
|
190
|
-
-
|
110
|
+
- example23/Rakefile
|
111
|
+
- example23/app/controllers/accounts_controller.rb
|
112
|
+
- example23/app/controllers/application_controller.rb
|
113
|
+
- example23/app/controllers/figments_controller.rb
|
114
|
+
- example23/app/helpers/application_helper.rb
|
115
|
+
- example23/app/models/account.rb
|
116
|
+
- example23/app/models/figment.rb
|
117
|
+
- example23/app/views/accounts/index.html.erb
|
118
|
+
- example23/app/views/layouts/application.html.erb
|
119
|
+
- example23/config/boot.rb
|
120
|
+
- example23/config/database.yml
|
121
|
+
- example23/config/environment.rb
|
122
|
+
- example23/config/environments/development.rb
|
123
|
+
- example23/config/environments/production.rb
|
124
|
+
- example23/config/environments/test.rb
|
125
|
+
- example23/config/initializers/inflections.rb
|
126
|
+
- example23/config/initializers/mime_types.rb
|
127
|
+
- example23/config/initializers/new_rails_defaults.rb
|
128
|
+
- example23/config/locales/en.yml
|
129
|
+
- example23/config/routes.rb
|
130
|
+
- example23/db/development.sqlite3
|
131
|
+
- example23/db/migrate/20080702154628_create_accounts.rb
|
132
|
+
- example23/db/migrate/20080702154820_create_figments.rb
|
133
|
+
- example23/db/s0_development.sqlite3
|
134
|
+
- example23/db/s0_test.sqlite3
|
135
|
+
- example23/db/s1_development.sqlite3
|
136
|
+
- example23/db/s1_test.sqlite3
|
137
|
+
- example23/db/schema.rb
|
138
|
+
- example23/db/test.sqlite3
|
139
|
+
- example23/log/development.log
|
140
|
+
- example23/log/test.log
|
141
|
+
- example23/public/404.html
|
142
|
+
- example23/public/422.html
|
143
|
+
- example23/public/500.html
|
144
|
+
- example23/public/dispatch.cgi
|
145
|
+
- example23/public/dispatch.fcgi
|
146
|
+
- example23/public/dispatch.rb
|
147
|
+
- example23/public/favicon.ico
|
148
|
+
- example23/public/images/rails.png
|
149
|
+
- example23/public/index.html
|
150
|
+
- example23/public/robots.txt
|
151
|
+
- example23/script/about
|
152
|
+
- example23/script/console
|
153
|
+
- example23/script/dbconsole
|
154
|
+
- example23/script/destroy
|
155
|
+
- example23/script/generate
|
156
|
+
- example23/script/performance/benchmarker
|
157
|
+
- example23/script/performance/profiler
|
158
|
+
- example23/script/performance/request
|
159
|
+
- example23/script/plugin
|
160
|
+
- example23/script/process/inspector
|
161
|
+
- example23/script/process/reaper
|
162
|
+
- example23/script/process/spawner
|
163
|
+
- example23/script/runner
|
164
|
+
- example23/script/server
|
165
|
+
- example23/test/fixtures/accounts.yml
|
166
|
+
- example23/test/functional/accounts_controller_test.rb
|
167
|
+
- example23/test/integration/account_figments_test.rb
|
168
|
+
- example23/test/performance/browsing_test.rb
|
169
|
+
- example23/test/test_helper.rb
|
170
|
+
- example23/vendor/plugins/data_fabric/init.rb
|
171
|
+
- example23/vendor/plugins/data_fabric/lib/data_fabric.rb
|
172
|
+
- example23/vendor/plugins/data_fabric/lib/data_fabric/ar20.rb
|
173
|
+
- example23/vendor/plugins/data_fabric/lib/data_fabric/ar22.rb
|
174
|
+
- example23/vendor/plugins/data_fabric/lib/data_fabric/dash.rb
|
175
|
+
- example23/vendor/plugins/data_fabric/lib/data_fabric/version.rb
|
176
|
+
- init.rb
|
177
|
+
- lib/data_fabric.rb
|
178
|
+
- lib/data_fabric/ar20.rb
|
179
|
+
- lib/data_fabric/ar22.rb
|
180
|
+
- lib/data_fabric/dash.rb
|
181
|
+
- lib/data_fabric/version.rb
|
182
|
+
- rails/init.rb
|
183
|
+
- test/connection_test.rb
|
184
|
+
- test/database.yml
|
185
|
+
- test/database.yml.mysql
|
186
|
+
- test/database_test.rb
|
187
|
+
- test/shard_test.rb
|
188
|
+
- test/test_helper.rb
|
189
|
+
- test/thread_test.rb
|
191
190
|
has_rdoc: true
|
192
191
|
homepage: http://github.com/mperham/data_fabric
|
192
|
+
licenses: []
|
193
|
+
|
193
194
|
post_install_message:
|
194
195
|
rdoc_options:
|
195
|
-
- --inline-source
|
196
196
|
- --charset=UTF-8
|
197
197
|
require_paths:
|
198
198
|
- lib
|
199
199
|
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
none: false
|
200
201
|
requirements:
|
201
202
|
- - ">="
|
202
203
|
- !ruby/object:Gem::Version
|
204
|
+
segments:
|
205
|
+
- 0
|
203
206
|
version: "0"
|
204
|
-
version:
|
205
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
none: false
|
206
209
|
requirements:
|
207
210
|
- - ">="
|
208
211
|
- !ruby/object:Gem::Version
|
212
|
+
segments:
|
213
|
+
- 0
|
209
214
|
version: "0"
|
210
|
-
version:
|
211
215
|
requirements: []
|
212
216
|
|
213
|
-
rubyforge_project:
|
214
|
-
rubygems_version: 1.3.
|
217
|
+
rubyforge_project:
|
218
|
+
rubygems_version: 1.3.7
|
215
219
|
signing_key:
|
216
|
-
specification_version:
|
220
|
+
specification_version: 3
|
217
221
|
summary: Sharding and replication support for ActiveRecord 2.x
|
218
|
-
test_files:
|
219
|
-
|
222
|
+
test_files:
|
223
|
+
- test/connection_test.rb
|
224
|
+
- test/database_test.rb
|
225
|
+
- test/shard_test.rb
|
226
|
+
- test/test_helper.rb
|
227
|
+
- test/thread_test.rb
|
data/VERSION.yml
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
-
require 'test_help'
|
4
|
-
|
5
|
-
class Test::Unit::TestCase
|
6
|
-
# Transactional fixtures accelerate your tests by wrapping each test method
|
7
|
-
# in a transaction that's rolled back on completion. This ensures that the
|
8
|
-
# test database remains unchanged so your fixtures don't have to be reloaded
|
9
|
-
# between every test method. Fewer database queries means faster tests.
|
10
|
-
#
|
11
|
-
# Read Mike Clark's excellent walkthrough at
|
12
|
-
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
13
|
-
#
|
14
|
-
# Every Active Record database supports transactions except MyISAM tables
|
15
|
-
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
16
|
-
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
17
|
-
# is recommended.
|
18
|
-
#
|
19
|
-
# The only drawback to using transactional fixtures is when you actually
|
20
|
-
# need to test transactions. Since your test is bracketed by a transaction,
|
21
|
-
# any transactions started in your code will be automatically rolled back.
|
22
|
-
self.use_transactional_fixtures = true
|
23
|
-
|
24
|
-
# Instantiated fixtures are slow, but give you @david where otherwise you
|
25
|
-
# would need people(:david). If you don't want to migrate your existing
|
26
|
-
# test cases which use the @david style and don't mind the speed hit (each
|
27
|
-
# instantiated fixtures translates to a database query per test method),
|
28
|
-
# then set this back to true.
|
29
|
-
self.use_instantiated_fixtures = false
|
30
|
-
|
31
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
32
|
-
#
|
33
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
|
-
# -- they do not yet inherit this setting
|
35
|
-
fixtures :all
|
36
|
-
|
37
|
-
# Add more helper methods to be used by all tests here...
|
38
|
-
end
|