okcomputer 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ok_computer/built_in_checks/mongoid_check.rb +14 -2
- data/lib/ok_computer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 348a7006a93a67bfd12d4e4c67c955b29d810a0f
|
4
|
+
data.tar.gz: 72f3d48f7f3890f501e347b35c5d291bf8d18b19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b42f71808c913eb59b258654f17056c3927b17e0e13c0de1fabac2fe95fe21ab7ba1737af3f45655edc6296faef43d0625e6da4cba7b9afb33e5a994a317cdaf
|
7
|
+
data.tar.gz: 461fd07b2a27b6b36370ee96f8dd281a96a3e874d85a602c71c27eabafb51bceff41064ad348fc1f64f296cfc41600e20ad75d31f022b91ea79eb12f27dc7b47
|
@@ -1,5 +1,17 @@
|
|
1
1
|
module OkComputer
|
2
2
|
class MongoidCheck < Check
|
3
|
+
attr_accessor :session
|
4
|
+
|
5
|
+
# Public: Initialize a check for a Mongoid replica set
|
6
|
+
#
|
7
|
+
# session - The name of the Mongoid session to use. Defaults to the
|
8
|
+
# default session.
|
9
|
+
def initialize(session = :default)
|
10
|
+
if Mongoid.respond_to?(:sessions)
|
11
|
+
self.session = Mongoid::Sessions.with_name(session)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
3
15
|
# Public: Return the status of the mongodb
|
4
16
|
def check
|
5
17
|
mark_message "Connected to mongodb #{mongodb_name}"
|
@@ -12,8 +24,8 @@ module OkComputer
|
|
12
24
|
#
|
13
25
|
# Returns a hash with the status of the db
|
14
26
|
def mongodb_stats
|
15
|
-
if
|
16
|
-
|
27
|
+
if session
|
28
|
+
session.command(dbStats: 1) # Mongoid 3+
|
17
29
|
else
|
18
30
|
Mongoid.database.stats # Mongoid 2
|
19
31
|
end
|
data/lib/ok_computer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: okcomputer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Byrne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|