ffwd-carbon 0.3.4 → 0.3.5

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: f25d5c10424ad9b079a9288d7505d947f8bc8e80
4
- data.tar.gz: cbed15ed201791e5db9ae8791efb3cf6d1388a64
3
+ metadata.gz: a601a8b1217697b3383f0afc711296650e1aecfc
4
+ data.tar.gz: 62305d04108083f3bdf652a0dd4e6758e20e4364
5
5
  SHA512:
6
- metadata.gz: 41fe8a07cbbda226712b76de2d3a26479f74fbcc3aec9a80396b26e5e1fab1db00ecdd7300ecabf09e6b7283fcbdec673048e5281859f32788dafa89e97834fa
7
- data.tar.gz: 3ac83deeb8c04edc929230490d5849328b6847361b67e316d566e3de0620c7dc189e01f1a1856a0b2bfe18ba26949b79f32460128753b1070f99c6c1b963d6d9
6
+ metadata.gz: d8c07bb4befd1239779237e68059b279e1d2190736b2766b2fe3844bf8822c9ee25439a8caf9356be18a9e4a11cab91e35680290a91cfecac39d2e9f34255ae6
7
+ data.tar.gz: 5f0d89e68211ebae611246d5a68fdf11803f5327169012f9a9290078c4e59b4c2c3c8201a8ab32c01d3bcf4ec80029d08aab7f6ce9b1204147a110d942c59bbb
@@ -27,6 +27,7 @@ module FFWD::Plugin
27
27
  DEFAULT_HOST = "localhost"
28
28
  DEFAULT_PORT = 2003
29
29
  DEFAULT_PROTOCOL = "tcp"
30
+ DEFAULT_KEY = "carbon"
30
31
 
31
32
  register_plugin "carbon",
32
33
  :description => "A plugin for the carbon line protocol.",
@@ -41,6 +42,12 @@ module FFWD::Plugin
41
42
  :help => [
42
43
  "Port to bind to."
43
44
  ]),
45
+ FFWD::Plugin.option(
46
+ :key, :default => DEFAULT_KEY,
47
+ :help => [
48
+ "Key to output metrics for.",
49
+ "All carbon paths will be added to the :what attribute."
50
+ ]),
44
51
  ]
45
52
 
46
53
  class InputTCP < FFWD::Plugin::Carbon::Connection
@@ -61,6 +68,7 @@ module FFWD::Plugin
61
68
  config[:host] ||= DEFAULT_HOST
62
69
  config[:port] ||= DEFAULT_PORT
63
70
  config[:protocol] ||= DEFAULT_PROTOCOL
71
+ config[:key] ||= DEFAULT_KEY
64
72
  protocol = FFWD.parse_protocol config[:protocol]
65
73
 
66
74
  unless connection = INPUTS[protocol.family]
@@ -23,6 +23,7 @@ module FFWD::Plugin
23
23
  def initialize bind, core, config
24
24
  @bind = bind
25
25
  @core = core
26
+ @key = config[:key]
26
27
  end
27
28
 
28
29
  def parse line
@@ -34,7 +35,9 @@ module FFWD::Plugin
34
35
  value = value.to_f unless value.nil?
35
36
  time = Time.at(timestamp.to_i)
36
37
 
37
- return {:key => path, :value => value, :time => time}
38
+ a = {:what => path}
39
+
40
+ return {:key => @key, :value => value, :time => time, :attributes => a}
38
41
  end
39
42
 
40
43
  def receive_line line
@@ -44,6 +47,7 @@ module FFWD::Plugin
44
47
  @bind.increment :received_metrics
45
48
  rescue => e
46
49
  @bind.log.error "Failed to receive data", e
50
+ @bind.increment :failed_metrics
47
51
  end
48
52
  end
49
53
  end
@@ -16,7 +16,7 @@
16
16
  module FFWD
17
17
  module Plugin
18
18
  module Carbon
19
- VERSION = "0.3.4"
19
+ VERSION = "0.3.5"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffwd-carbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Parm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-11 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffwd
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.4
19
+ version: 0.3.5
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.4
26
+ version: 0.3.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement