mongodb-graphite 1.0.7 → 1.1.1

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: ae7741dfb071753cc1803bc70823e059dacea62c
4
- data.tar.gz: b2abdd5c6c387cf3dedfc68740ba8955ab5b6df3
3
+ metadata.gz: 7f7f3426fb0b0aa9ba7b56b8622fabd7ec644724
4
+ data.tar.gz: 5ad1203bbd02098fe4e4ac232fa97b654e381c5d
5
5
  SHA512:
6
- metadata.gz: d5b734dbb97272cae1db981324200fb7276bde72bef8d644f16d22af6b884e81890f5ff4a5b07bbbd319a871f0f307ab9a55a560e8bdeba145658180efe83645
7
- data.tar.gz: f1d4d5fdcaefda34d56ac8194e0bcc5358b68f008ea6f121bb4d3238ca7aa31681bd1867ef13f7f6d67e11eee16ef24fe070b50634223a101791f9ba31a9e503
6
+ metadata.gz: 9370eec22ce380c98d93fa567f09b699964f9b2bcfb35f93300dd3e7686e6b535e72770ecde4abc8469b436a285ceee7e009c335b35e796fd655588c736472e1
7
+ data.tar.gz: ed8d2315f0b82e104bd82d1a4b13c5ab99ee3efe5a9d5ca5bb52c610a5473af29df5769ae372817b3ed42c1dde5192ae1b6698c6b34f547014c3053f5c2df2fa
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongodb-graphite (1.0.0)
4
+ mongodb-graphite (1.1.0)
5
5
  daemons
6
- mongo (>= 1.5.2)
6
+ mongo (>= 1.8.0)
7
7
  simple-graphite (>= 2.1.0)
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- bson (1.8.6)
12
+ bson (1.10.0)
13
13
  daemons (1.1.9)
14
- mongo (1.8.6)
15
- bson (~> 1.8.6)
14
+ mongo (1.10.0)
15
+ bson (~> 1.10.0)
16
16
  simple-graphite (2.1.0)
17
17
 
18
18
  PLATFORMS
data/README.md CHANGED
@@ -30,7 +30,7 @@ instance 'mongoD' do
30
30
  port '27017'
31
31
  prefix_callback (lambda { |stats|
32
32
  process_type = stats['process']
33
- 'test.anothermongo.#{process_type}"
33
+ "test.anothermongo.#{process_type}"
34
34
  } )
35
35
  end
36
36
  ```
@@ -20,6 +20,7 @@ module MongodbGraphite
20
20
  @host = 'localhost'
21
21
  @fields_to_ignore = %w(host version process pid uptimeMillis localTime extra_info.note backgroundFlushing.last_finished repl.setName repl.hosts repl.arbiters repl.primary repl.me ok)
22
22
  @prefix_callback = nil
23
+ @replacements = { /locks\.\.\./ => 'locks.global.' }
23
24
  end
24
25
 
25
26
  def reload(options)
@@ -42,16 +43,23 @@ module MongodbGraphite
42
43
  end
43
44
 
44
45
  def to_graphite
45
- @stats = to_hash
46
+ @stats = to_hash
46
47
  with_prefix = Hash.new
47
48
  @stats.each do |k,v|
48
- with_prefix[ [prefix, k].join('.')] = to_i(v)
49
+ key = format_key k
50
+ with_prefix[ [prefix, key].join('.')] = to_i(v)
49
51
  end
50
52
  with_prefix.reject { |k,v| ignored_fields.include? k }
51
53
  end
52
54
 
53
55
  private
54
56
 
57
+ def format_key(key)
58
+ @replacements.inject(key) do |modified_key, kvp|
59
+ modified_key.gsub(kvp[0], kvp[1])
60
+ end
61
+ end
62
+
55
63
  def prefix
56
64
  return @prefix_callback.call(@stats) unless @prefix_callback.nil?
57
65
  nil
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mongodb-graphite"
6
- s.version = '1.0.7'
6
+ s.version = '1.1.1'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Grégoire Seux"]
9
9
  s.email = ["g.seux@criteo.com"]
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongodb-graphite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simple-graphite
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: daemons
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: ''
@@ -60,7 +60,7 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
63
+ - ".gitignore"
64
64
  - Gemfile
65
65
  - Gemfile.lock
66
66
  - README.md
@@ -79,18 +79,19 @@ require_paths:
79
79
  - lib
80
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.0.3
92
+ rubygems_version: 2.2.2
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: ''
96
96
  test_files: []
97
+ has_rdoc: