ffwd-carbon 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ffwd/plugin/carbon.rb +8 -0
- data/lib/ffwd/plugin/carbon/connection.rb +5 -1
- data/lib/ffwd/plugin/carbon/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a601a8b1217697b3383f0afc711296650e1aecfc
|
4
|
+
data.tar.gz: 62305d04108083f3bdf652a0dd4e6758e20e4364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c07bb4befd1239779237e68059b279e1d2190736b2766b2fe3844bf8822c9ee25439a8caf9356be18a9e4a11cab91e35680290a91cfecac39d2e9f34255ae6
|
7
|
+
data.tar.gz: 5f0d89e68211ebae611246d5a68fdf11803f5327169012f9a9290078c4e59b4c2c3c8201a8ab32c01d3bcf4ec80029d08aab7f6ce9b1204147a110d942c59bbb
|
data/lib/ffwd/plugin/carbon.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
+
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
|
+
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.
|
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.
|
26
|
+
version: 0.3.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|