ffwd-collectd 0.1.7 → 0.2.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 51efe82a0a7d19337420ffdbd9bf160e8322b4d5
4
+ data.tar.gz: 72c15751dec28ab04b539069e8aeb31820fbf053
5
+ SHA512:
6
+ metadata.gz: 7414e955b753c15e7ac621d7afe5bd7b1a426a7357a302a8027506ec330324c1e13fadd787ab5f8bfb9698cce754d6c736eddddd3d6e71b168d259ad03fd09a5
7
+ data.tar.gz: d71cd9018530179a3dc7359eb3d3155c9584757a406170d55e3eaa4cd115fe0a2a4a94a4e91678f40c21380827148186640a33e10a70edea55da86cbf3a00d53
@@ -13,23 +13,17 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
- require 'ffwd/logging'
17
16
  require 'ffwd/connection'
18
17
 
19
18
  require_relative 'parser'
19
+ require_relative 'types_db'
20
20
 
21
21
  module FFWD::Plugin::Collectd
22
22
  class Connection < FFWD::Connection
23
- include FFWD::Logging
24
-
25
- def self.plugin_type
26
- "collectd_in"
27
- end
28
-
29
- def initialize bind, core, types_db
23
+ def initialize bind, core, config
30
24
  @bind = bind
31
25
  @core = core
32
- @types_db = types_db
26
+ @types_db = TypesDB.open config[:types_db]
33
27
  end
34
28
 
35
29
  def receive_data(data)
@@ -77,7 +71,7 @@ module FFWD::Plugin::Collectd
77
71
  end
78
72
  end
79
73
  rescue => e
80
- log.error "Failed to receive data", e
74
+ @bind.log.error "Failed to receive data", e
81
75
  end
82
76
  end
83
77
  end
@@ -16,7 +16,7 @@
16
16
  module FFWD
17
17
  module Plugin
18
18
  module Collectd
19
- VERSION = "0.1.7"
19
+ VERSION = "0.2.0"
20
20
  end
21
21
  end
22
22
  end
@@ -18,7 +18,6 @@ require 'ffwd/protocol'
18
18
  require 'ffwd/logging'
19
19
 
20
20
  require_relative 'collectd/connection'
21
- require_relative 'collectd/types_db'
22
21
 
23
22
  module FFWD::Plugin::Collectd
24
23
  include FFWD::Plugin
@@ -47,21 +46,31 @@ module FFWD::Plugin::Collectd
47
46
  ),
48
47
  ]
49
48
 
50
- def self.setup_input opts, core
51
- opts[:host] ||= DEFAULT_HOST
52
- opts[:port] ||= DEFAULT_PORT
53
- opts[:types_db] ||= DEFAULT_TYPES_DB
54
- protocol = FFWD.parse_protocol(opts[:protocol] || "udp")
55
- types_db = TypesDB.open opts[:types_db]
56
- protocol.bind opts, core, log, Connection, types_db
49
+ class InputTCP < FFWD::Plugin::Collectd::Connection
50
+ def self.plugin_type
51
+ "collectd_tcp_in"
52
+ end
57
53
  end
58
54
 
59
- def self.setup_tunnel opts, core, tunnel
60
- opts[:port] ||= DEFAULT_PORT
61
- opts[:types_db] ||= DEFAULT_TYPES_DB
62
- protocol = FFWD.parse_protocol(opts[:protocol] || "udp")
63
- protocol.tunnel log, opts, Connection
64
- types_db = TypesDB.open opts[:types_db]
65
- protocol.bind opts, core, tunnel, log, Connection, types_db
55
+ class InputUDP < FFWD::Plugin::Collectd::Connection
56
+ def self.plugin_type
57
+ "collectd_udp_in"
58
+ end
59
+ end
60
+
61
+ INPUTS = {:tcp => InputTCP, :udp => InputUDP}
62
+
63
+ def self.setup_input config
64
+ config[:host] ||= DEFAULT_HOST
65
+ config[:port] ||= DEFAULT_PORT
66
+ config[:types_db] ||= DEFAULT_TYPES_DB
67
+ config[:protocol] ||= "udp"
68
+ protocol = FFWD.parse_protocol config[:protocol]
69
+
70
+ unless connection = INPUTS[protocol.family]
71
+ raise "Not a supported protocol: #{protocol}"
72
+ end
73
+
74
+ protocol.bind config, log, connection
66
75
  end
67
76
  end
metadata CHANGED
@@ -1,32 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffwd-collectd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - John-John Tedro
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-30 00:00:00.000000000 Z
11
+ date: 2014-06-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ffwd
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.1.7
19
+ version: 0.2.0
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 0.1.7
26
+ version: 0.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-mocks
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
30
55
  description:
31
56
  email:
32
57
  - udoprog@spotify.com
@@ -34,34 +59,33 @@ executables: []
34
59
  extensions: []
35
60
  extra_rdoc_files: []
36
61
  files:
37
- - lib/ffwd/plugin/collectd/version.rb
38
62
  - lib/ffwd/plugin/collectd/parser.rb
39
63
  - lib/ffwd/plugin/collectd/types_db.rb
40
64
  - lib/ffwd/plugin/collectd/connection.rb
65
+ - lib/ffwd/plugin/collectd/version.rb
41
66
  - lib/ffwd/plugin/collectd.rb
42
67
  homepage: https://github.com/spotify/ffwd
43
68
  licenses:
44
69
  - Apache 2.0
70
+ metadata: {}
45
71
  post_install_message:
46
72
  rdoc_options: []
47
73
  require_paths:
48
74
  - lib
49
75
  required_ruby_version: !ruby/object:Gem::Requirement
50
- none: false
51
76
  requirements:
52
- - - ! '>='
77
+ - - '>='
53
78
  - !ruby/object:Gem::Version
54
79
  version: '0'
55
80
  required_rubygems_version: !ruby/object:Gem::Requirement
56
- none: false
57
81
  requirements:
58
- - - ! '>='
82
+ - - '>='
59
83
  - !ruby/object:Gem::Version
60
84
  version: '0'
61
85
  requirements: []
62
86
  rubyforge_project:
63
- rubygems_version: 1.8.23
87
+ rubygems_version: 2.0.3
64
88
  signing_key:
65
- specification_version: 3
89
+ specification_version: 4
66
90
  summary: collectd support for FFWD.
67
91
  test_files: []