bipbip 0.7.10 → 0.7.11
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 +7 -12
- data/lib/bipbip/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9847767e1b42d39beae512246c9984eb5df71fb0
|
4
|
+
data.tar.gz: 1df668f789e88d2f3a847ba3490ebc9696fa37cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3196a398dff8d5f726bf8c59e9a23c67f66a5ed224f779b720be5efbb9ef96a61f47b67de952987aca264f230efd260de47cde851425fd1d3172c123db2ce81
|
7
|
+
data.tar.gz: fa480f193cb9a747e0763595727c6a0a29c8874ba57041e12d15f703d55091ed44820296f33d9ba78caba3c63c40816ace1ccf44adaf0f0065b8fa8144d56053
|
@@ -4,8 +4,6 @@ module Bipbip
|
|
4
4
|
class Plugin::Mongodb < Plugin
|
5
5
|
def metrics_schema
|
6
6
|
[
|
7
|
-
{ name: 'flushing_last_ms', type: 'gauge', unit: 'ms' },
|
8
|
-
{ name: 'btree_misses', type: 'gauge', unit: 'misses' },
|
9
7
|
{ name: 'op_inserts', type: 'counter' },
|
10
8
|
{ name: 'op_queries', type: 'counter' },
|
11
9
|
{ name: 'op_updates', type: 'counter' },
|
@@ -28,17 +26,10 @@ module Bipbip
|
|
28
26
|
|
29
27
|
def monitor
|
30
28
|
status = fetch_server_status
|
31
|
-
slow_queries_status = fetch_slow_queries_status
|
32
29
|
all_index_size = total_index_size
|
33
30
|
|
34
31
|
data = {}
|
35
32
|
|
36
|
-
if status['indexCounters']
|
37
|
-
data['btree_misses'] = status['indexCounters']['misses'].to_i
|
38
|
-
end
|
39
|
-
if status['backgroundFlushing']
|
40
|
-
data['flushing_last_ms'] = status['backgroundFlushing']['last_ms'].to_i
|
41
|
-
end
|
42
33
|
if status['opcounters']
|
43
34
|
data['op_inserts'] = status['opcounters']['insert'].to_i
|
44
35
|
data['op_queries'] = status['opcounters']['query'].to_i
|
@@ -64,9 +55,13 @@ module Bipbip
|
|
64
55
|
data['replication_lag'] = replication_lag
|
65
56
|
end
|
66
57
|
|
67
|
-
|
68
|
-
|
69
|
-
|
58
|
+
if status['repl'] && status['repl']['ismaster'] == true
|
59
|
+
slow_queries_status = fetch_slow_queries_status
|
60
|
+
|
61
|
+
data['slow_queries_count'] = slow_queries_status['total']['count']
|
62
|
+
data['slow_queries_time_avg'] = slow_queries_status['total']['time'].to_f / (slow_queries_status['total']['count'].to_f.nonzero? || 1)
|
63
|
+
data['slow_queries_time_max'] = slow_queries_status['max']['time']
|
64
|
+
end
|
70
65
|
|
71
66
|
unless router?
|
72
67
|
data['total_index_size'] = all_index_size / (1024 * 1024)
|
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.7.
|
4
|
+
version: 0.7.11
|
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:
|
13
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: copperegg-revealmetrics
|
@@ -226,16 +226,16 @@ dependencies:
|
|
226
226
|
name: rake
|
227
227
|
requirement: !ruby/object:Gem::Requirement
|
228
228
|
requirements:
|
229
|
-
- - "
|
229
|
+
- - "~>"
|
230
230
|
- !ruby/object:Gem::Version
|
231
|
-
version:
|
231
|
+
version: 11.1.0
|
232
232
|
type: :development
|
233
233
|
prerelease: false
|
234
234
|
version_requirements: !ruby/object:Gem::Requirement
|
235
235
|
requirements:
|
236
|
-
- - "
|
236
|
+
- - "~>"
|
237
237
|
- !ruby/object:Gem::Version
|
238
|
-
version:
|
238
|
+
version: 11.1.0
|
239
239
|
- !ruby/object:Gem::Dependency
|
240
240
|
name: rspec
|
241
241
|
requirement: !ruby/object:Gem::Requirement
|