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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b1923170245c3dd032b066641934660639c9c68
4
- data.tar.gz: ab0244849d492ff035867e668c7515c3a979287e
3
+ metadata.gz: 9847767e1b42d39beae512246c9984eb5df71fb0
4
+ data.tar.gz: 1df668f789e88d2f3a847ba3490ebc9696fa37cd
5
5
  SHA512:
6
- metadata.gz: b9db1d07c014abc4d2cc2096381c5624eaad5699295687747e2fac8c2b8f12cd09cb474f44cd1bb3fe9e51537a5a67ff9f868b63e8e8a92ad7c4384770cd0829
7
- data.tar.gz: d6e2f76c5785dfdf2bf0b587ba8fe311f2b11446f537fcebbe18a448e778e63a313a97d36f8537b0e9c3a6a6419e33a3aea3925950a696c5f297c67b5d3c72ea
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
- data['slow_queries_count'] = slow_queries_status['total']['count']
68
- data['slow_queries_time_avg'] = slow_queries_status['total']['time'].to_f / (slow_queries_status['total']['count'].to_f.nonzero? || 1)
69
- data['slow_queries_time_max'] = slow_queries_status['max']['time']
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)
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.7.10'.freeze
2
+ VERSION = '0.7.11'.freeze
3
3
  end
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.10
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: 2016-11-16 00:00:00.000000000 Z
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: '0'
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: '0'
238
+ version: 11.1.0
239
239
  - !ruby/object:Gem::Dependency
240
240
  name: rspec
241
241
  requirement: !ruby/object:Gem::Requirement