bipbip 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bipbip/plugin/mongodb.rb +11 -3
- data/lib/bipbip/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 297ab31c33a70036e4877f4b5b44d47acdbc9a32
|
4
|
+
data.tar.gz: f48f374bb3cd80e87ab5ece81c99ced7b7c2211a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4acccd584041353c38d5e234836474d9fcc44b218b2582fc06ee0d5b6ade33d0f78cf11a14a67e1470988ad4fcbdd18b211f3f0f561a12bf04a0300b8e8560b0
|
7
|
+
data.tar.gz: e971c88b6ab120a8f20be1d44759f71b1fab52c4f039a14bc315891e24a82b674fa42f5ae339a1a2b52bd823e6ac0e5d1c741d1bad0cda1258a81e7895c84030
|
@@ -62,7 +62,7 @@ module Bipbip
|
|
62
62
|
data['replication_lag'] = replication_lag
|
63
63
|
end
|
64
64
|
|
65
|
-
data['slow_queries'] =
|
65
|
+
data['slow_queries'] = calculate_slow_queries
|
66
66
|
|
67
67
|
data
|
68
68
|
end
|
@@ -103,8 +103,16 @@ module Bipbip
|
|
103
103
|
old
|
104
104
|
end
|
105
105
|
|
106
|
-
def
|
107
|
-
|
106
|
+
def calculate_slow_queries
|
107
|
+
timestamp_last_check = slow_query_last_check
|
108
|
+
|
109
|
+
slow_queries = fetch_slow_queries_count(slow_query_threshold, timestamp_last_check)
|
110
|
+
|
111
|
+
(slow_queries/(Time.now - timestamp_last_check)).to_i
|
112
|
+
end
|
113
|
+
|
114
|
+
def fetch_slow_queries_count(millis_min, ts_min)
|
115
|
+
query = {'millis' => {'$gte' => millis_min}, 'ts' => {'$gte' => ts_min}}
|
108
116
|
database_names_ignore = ['admin', 'system']
|
109
117
|
|
110
118
|
database_list = (mongodb_client.database_names - database_names_ignore).map { |name| mongodb_database(name) }
|
data/lib/bipbip/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bipbip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cargo Media
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-01-
|
13
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: copperegg
|
@@ -272,3 +272,4 @@ signing_key:
|
|
272
272
|
specification_version: 4
|
273
273
|
summary: Gather services data and store in CopperEgg
|
274
274
|
test_files: []
|
275
|
+
has_rdoc:
|