data_fabric 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,12 @@
1
1
  DataFabric changelog
2
2
 
3
- v1.2.3 - 2008-02-05
3
+ v1.2.4 - 2009-03-09
4
+
5
+ - Add FiveRuns Dash recipe for data_fabric. See http://dash.fiveruns.com for details.
6
+ - Fixed incorrect remove_connection method signature.
7
+ - The official data_fabric repository is now http://github.com/mperham/data_fabric.
8
+
9
+ v1.2.3 - 2009-02-05
4
10
 
5
11
  - Release connections at the end of each Rails action. If you see 5 second
6
12
  pauses in your application, it's because the connection pool is timing out
@@ -32,4 +38,4 @@ v1.1.0 - 2008-11-22
32
38
 
33
39
  Detailed commit history:
34
40
 
35
- http://github.com/fiveruns/data_fabric/commits/master
41
+ http://github.com/mperham/data_fabric/commits/master
data/Manifest CHANGED
@@ -105,6 +105,7 @@ init.rb
105
105
  lib/data_fabric/ar20.rb
106
106
  lib/data_fabric/ar22.rb
107
107
  lib/data_fabric/version.rb
108
+ lib/data_fabric/dash.rb
108
109
  lib/data_fabric.rb
109
110
  Manifest
110
111
  Rakefile
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Echoe.new 'data_fabric' do |p|
9
9
  p.email = 'mperham@gmail.com'
10
10
  p.project = 'fiveruns'
11
11
  p.summary = 'Sharding and replication support for ActiveRecord 2.x'
12
- p.url = "http://github.com/fiveruns/data_fabric"
12
+ p.url = "http://github.com/mperham/data_fabric"
13
13
  p.development_dependencies = []
14
14
  p.rubygems_version = nil
15
15
  p.include_rakefile = true
@@ -90,8 +90,8 @@ def create_mysql(create, db_name)
90
90
  end
91
91
 
92
92
  # Test coverage
93
- gem 'spicycode-rcov' rescue nil
94
93
  begin
94
+ gem 'spicycode-rcov' rescue nil
95
95
  require 'rcov/rcovtask'
96
96
 
97
97
  desc "Generate coverage numbers for all locally installed versions of ActiveRecord"
data/data_fabric.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{data_fabric}
5
- s.version = "1.2.3"
5
+ s.version = "1.2.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mike Perham"]
9
- s.date = %q{2009-02-05}
9
+ s.date = %q{2009-03-09}
10
10
  s.description = %q{Sharding and replication support for ActiveRecord 2.x}
11
11
  s.email = %q{mperham@gmail.com}
12
- s.extra_rdoc_files = ["CHANGELOG", "lib/data_fabric/ar20.rb", "lib/data_fabric/ar22.rb", "lib/data_fabric/version.rb", "lib/data_fabric.rb", "README.rdoc"]
13
- s.files = ["CHANGELOG", "example/app/controllers/accounts_controller.rb", "example/app/controllers/application.rb", "example/app/controllers/figments_controller.rb", "example/app/helpers/accounts_helper.rb", "example/app/helpers/application_helper.rb", "example/app/helpers/figments_helper.rb", "example/app/models/account.rb", "example/app/models/figment.rb", "example/app/views/accounts/index.html.erb", "example/app/views/layouts/application.html.erb", "example/config/boot.rb", "example/config/database.yml", "example/config/environment.rb", "example/config/environments/development.rb", "example/config/environments/production.rb", "example/config/environments/test.rb", "example/config/initializers/inflections.rb", "example/config/initializers/mime_types.rb", "example/config/initializers/new_rails_defaults.rb", "example/config/routes.rb", "example/db/migrate/20080702154628_create_accounts.rb", "example/db/migrate/20080702154820_create_figments.rb", "example/db/schema.rb", "example/public/404.html", "example/public/422.html", "example/public/500.html", "example/public/dispatch.cgi", "example/public/dispatch.fcgi", "example/public/dispatch.rb", "example/public/favicon.ico", "example/public/images/rails.png", "example/public/robots.txt", "example/Rakefile", "example/script/about", "example/script/console", "example/script/dbconsole", "example/script/destroy", "example/script/generate", "example/script/performance/benchmarker", "example/script/performance/profiler", "example/script/performance/request", "example/script/plugin", "example/script/process/inspector", "example/script/process/reaper", "example/script/process/spawner", "example/script/runner", "example/script/server", "example/test/fixtures/accounts.yml", "example/test/functional/accounts_controller_test.rb", "example/test/integration/account_figments_test.rb", "example/test/test_helper.rb", "example22/app/controllers/accounts_controller.rb", "example22/app/controllers/application.rb", "example22/app/controllers/figments_controller.rb", "example22/app/helpers/application_helper.rb", "example22/app/models/account.rb", "example22/app/models/figment.rb", "example22/app/views/accounts/index.html.erb", "example22/app/views/layouts/application.html.erb", "example22/config/boot.rb", "example22/config/database.yml", "example22/config/environment.rb", "example22/config/environments/development.rb", "example22/config/environments/production.rb", "example22/config/environments/test.rb", "example22/config/initializers/inflections.rb", "example22/config/initializers/mime_types.rb", "example22/config/initializers/new_rails_defaults.rb", "example22/config/locales/en.yml", "example22/config/routes.rb", "example22/db/migrate/20080702154628_create_accounts.rb", "example22/db/migrate/20080702154820_create_figments.rb", "example22/public/404.html", "example22/public/422.html", "example22/public/500.html", "example22/public/dispatch.cgi", "example22/public/dispatch.fcgi", "example22/public/dispatch.rb", "example22/public/favicon.ico", "example22/public/images/rails.png", "example22/public/index.html", "example22/public/robots.txt", "example22/Rakefile", "example22/script/about", "example22/script/console", "example22/script/dbconsole", "example22/script/destroy", "example22/script/generate", "example22/script/performance/benchmarker", "example22/script/performance/profiler", "example22/script/performance/request", "example22/script/plugin", "example22/script/process/inspector", "example22/script/process/reaper", "example22/script/process/spawner", "example22/script/runner", "example22/script/server", "example22/test/fixtures/accounts.yml", "example22/test/functional/accounts_controller_test.rb", "example22/test/integration/account_figments_test.rb", "example22/test/performance/browsing_test.rb", "example22/test/test_helper.rb", "init.rb", "lib/data_fabric/ar20.rb", "lib/data_fabric/ar22.rb", "lib/data_fabric/version.rb", "lib/data_fabric.rb", "Manifest", "Rakefile", "README.rdoc", "test/connection_test.rb", "test/database.yml", "test/database.yml.mysql", "test/database_test.rb", "test/shard_test.rb", "test/test_helper.rb", "test/thread_test.rb", "TESTING.rdoc", "data_fabric.gemspec"]
12
+ s.extra_rdoc_files = ["CHANGELOG", "lib/data_fabric/ar20.rb", "lib/data_fabric/ar22.rb", "lib/data_fabric/version.rb", "lib/data_fabric/dash.rb", "lib/data_fabric.rb", "README.rdoc"]
13
+ s.files = ["CHANGELOG", "example/app/controllers/accounts_controller.rb", "example/app/controllers/application.rb", "example/app/controllers/figments_controller.rb", "example/app/helpers/accounts_helper.rb", "example/app/helpers/application_helper.rb", "example/app/helpers/figments_helper.rb", "example/app/models/account.rb", "example/app/models/figment.rb", "example/app/views/accounts/index.html.erb", "example/app/views/layouts/application.html.erb", "example/config/boot.rb", "example/config/database.yml", "example/config/environment.rb", "example/config/environments/development.rb", "example/config/environments/production.rb", "example/config/environments/test.rb", "example/config/initializers/inflections.rb", "example/config/initializers/mime_types.rb", "example/config/initializers/new_rails_defaults.rb", "example/config/routes.rb", "example/db/migrate/20080702154628_create_accounts.rb", "example/db/migrate/20080702154820_create_figments.rb", "example/db/schema.rb", "example/public/404.html", "example/public/422.html", "example/public/500.html", "example/public/dispatch.cgi", "example/public/dispatch.fcgi", "example/public/dispatch.rb", "example/public/favicon.ico", "example/public/images/rails.png", "example/public/robots.txt", "example/Rakefile", "example/script/about", "example/script/console", "example/script/dbconsole", "example/script/destroy", "example/script/generate", "example/script/performance/benchmarker", "example/script/performance/profiler", "example/script/performance/request", "example/script/plugin", "example/script/process/inspector", "example/script/process/reaper", "example/script/process/spawner", "example/script/runner", "example/script/server", "example/test/fixtures/accounts.yml", "example/test/functional/accounts_controller_test.rb", "example/test/integration/account_figments_test.rb", "example/test/test_helper.rb", "example22/app/controllers/accounts_controller.rb", "example22/app/controllers/application.rb", "example22/app/controllers/figments_controller.rb", "example22/app/helpers/application_helper.rb", "example22/app/models/account.rb", "example22/app/models/figment.rb", "example22/app/views/accounts/index.html.erb", "example22/app/views/layouts/application.html.erb", "example22/config/boot.rb", "example22/config/database.yml", "example22/config/environment.rb", "example22/config/environments/development.rb", "example22/config/environments/production.rb", "example22/config/environments/test.rb", "example22/config/initializers/inflections.rb", "example22/config/initializers/mime_types.rb", "example22/config/initializers/new_rails_defaults.rb", "example22/config/locales/en.yml", "example22/config/routes.rb", "example22/db/migrate/20080702154628_create_accounts.rb", "example22/db/migrate/20080702154820_create_figments.rb", "example22/public/404.html", "example22/public/422.html", "example22/public/500.html", "example22/public/dispatch.cgi", "example22/public/dispatch.fcgi", "example22/public/dispatch.rb", "example22/public/favicon.ico", "example22/public/images/rails.png", "example22/public/index.html", "example22/public/robots.txt", "example22/Rakefile", "example22/script/about", "example22/script/console", "example22/script/dbconsole", "example22/script/destroy", "example22/script/generate", "example22/script/performance/benchmarker", "example22/script/performance/profiler", "example22/script/performance/request", "example22/script/plugin", "example22/script/process/inspector", "example22/script/process/reaper", "example22/script/process/spawner", "example22/script/runner", "example22/script/server", "example22/test/fixtures/accounts.yml", "example22/test/functional/accounts_controller_test.rb", "example22/test/integration/account_figments_test.rb", "example22/test/performance/browsing_test.rb", "example22/test/test_helper.rb", "init.rb", "lib/data_fabric/ar20.rb", "lib/data_fabric/ar22.rb", "lib/data_fabric/version.rb", "lib/data_fabric/dash.rb", "lib/data_fabric.rb", "Manifest", "Rakefile", "README.rdoc", "test/connection_test.rb", "test/database.yml", "test/database.yml.mysql", "test/database_test.rb", "test/shard_test.rb", "test/test_helper.rb", "test/thread_test.rb", "TESTING.rdoc", "data_fabric.gemspec"]
14
14
  s.has_rdoc = true
15
- s.homepage = %q{http://github.com/fiveruns/data_fabric}
15
+ s.homepage = %q{http://github.com/mperham/data_fabric}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Data_fabric", "--main", "README.rdoc"]
17
17
  s.require_paths = ["lib"]
18
18
  s.rubyforge_project = %q{fiveruns}
@@ -30,8 +30,8 @@ module DataFabric
30
30
  @proxy.connected?
31
31
  end
32
32
 
33
- def remove_connection(klass)
34
- DataFabric.log(Logger::ERROR) { "remove_connection not implemented by data_fabric" }
33
+ def remove_connection(klass=self)
34
+ DataFabric.log(Logger::WARN) { "remove_connection not implemented by data_fabric" }
35
35
  end
36
36
 
37
37
  def connection_pool
@@ -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
@@ -1,5 +1,5 @@
1
1
  module DataFabric
2
2
  module Version
3
- STRING = "1.2.3"
3
+ STRING = "1.2.4"
4
4
  end
5
5
  end
@@ -43,7 +43,9 @@ end
43
43
  class ConnectionTest < Test::Unit::TestCase
44
44
 
45
45
  def test_should_install_into_arbase
46
- assert PrefixModel.methods.include?('data_fabric')
46
+ # Ruby 1.8 vs 1.9 difference
47
+ meth = PrefixModel.methods.first.is_a?(Symbol) ? :data_fabric : 'data_fabric'
48
+ assert PrefixModel.methods.include?(meth)
47
49
  end
48
50
 
49
51
  def test_prefix_connection_name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_fabric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-05 00:00:00 -06:00
12
+ date: 2009-03-09 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -24,6 +24,7 @@ extra_rdoc_files:
24
24
  - lib/data_fabric/ar20.rb
25
25
  - lib/data_fabric/ar22.rb
26
26
  - lib/data_fabric/version.rb
27
+ - lib/data_fabric/dash.rb
27
28
  - lib/data_fabric.rb
28
29
  - README.rdoc
29
30
  files:
@@ -134,6 +135,7 @@ files:
134
135
  - lib/data_fabric/ar20.rb
135
136
  - lib/data_fabric/ar22.rb
136
137
  - lib/data_fabric/version.rb
138
+ - lib/data_fabric/dash.rb
137
139
  - lib/data_fabric.rb
138
140
  - Manifest
139
141
  - Rakefile
@@ -148,7 +150,7 @@ files:
148
150
  - TESTING.rdoc
149
151
  - data_fabric.gemspec
150
152
  has_rdoc: true
151
- homepage: http://github.com/fiveruns/data_fabric
153
+ homepage: http://github.com/mperham/data_fabric
152
154
  post_install_message:
153
155
  rdoc_options:
154
156
  - --line-numbers