stethoscope 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stethoscope (0.2.0)
4
+ stethoscope (0.2.1)
5
5
  dictionary (>= 1.0)
6
6
  rack (> 1.0)
7
7
  tilt (>= 1.0)
@@ -18,7 +18,7 @@ GEM
18
18
  rack (>= 1.0)
19
19
  rake (0.8.7)
20
20
  rspec-core (2.0.0.beta.20)
21
- tilt (1.3.2)
21
+ tilt (1.3.4)
22
22
 
23
23
  PLATFORMS
24
24
  ruby
data/README.md CHANGED
@@ -67,6 +67,14 @@ Any exceptions are caught and added to the response with the _:error_ key. The
67
67
  * Check name - :database
68
68
  * require 'stethoscope/checks/data\_mapper'
69
69
  * Included if the DataMapper constant is present in Rails 3
70
+ * Mongoid 2.x
71
+ * Check name - :database
72
+ * require 'stethoscope/checks/mongoid2'
73
+ * Included if the Mongoid constant is present in Rails 3
74
+ * Mongoid 3.x
75
+ * Check name - :database
76
+ * require 'stethoscope/checks/mongoid'
77
+ * Included if the Mongoid and Moped constants are present in Rails 3
70
78
 
71
79
  ### Template
72
80
 
@@ -0,0 +1 @@
1
+ require 'stethoscope/checks/mongoid3'
@@ -0,0 +1,8 @@
1
+ require 'stethoscope'
2
+
3
+ # Provides a check for mongoid databases
4
+ Stethoscope.check :database do |response|
5
+ collection_names = Mongoid.database.collection_names
6
+ response["collection count"] = collection_names.size
7
+ response["Mongoid"] = "OK"
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'stethoscope'
2
+
3
+ # Provides a check for mongoid databases
4
+ Stethoscope.check :database do |response|
5
+ collections = Mongoid::Sessions.default.collections
6
+ response["collection count"] = collections.size
7
+ response["Mongoid"] = "OK"
8
+ end
@@ -7,6 +7,10 @@ if defined?(Rails::Railtie)
7
7
 
8
8
  require 'stethoscope/checks/active_record' if defined?(ActiveRecord)
9
9
  require 'stethoscope/checks/data_mapper' if defined?(DataMapper)
10
+ if defined?(Mongoid)
11
+ mongoid_check = defined?(Moped) ? "mongoid3" : "mongoid2"
12
+ require "stethoscope/checks/#{mongoid_check}"
13
+ end
10
14
  end
11
15
  end
12
16
  end
@@ -1,3 +1,3 @@
1
1
  class Stethoscope
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stethoscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -188,6 +188,9 @@ files:
188
188
  - lib/stethoscope.rb
189
189
  - lib/stethoscope/checks/active_record.rb
190
190
  - lib/stethoscope/checks/data_mapper.rb
191
+ - lib/stethoscope/checks/mongoid.rb
192
+ - lib/stethoscope/checks/mongoid2.rb
193
+ - lib/stethoscope/checks/mongoid3.rb
191
194
  - lib/stethoscope/rails.rb
192
195
  - lib/stethoscope/template.erb
193
196
  - lib/stethoscope/version.rb