fluent-plugin-ping-message 0.1.2 → 0.2.0

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: 8192e9dd9fcbd4664b27ab790f63ee9aa41d0bb8
4
- data.tar.gz: 3e63fbcfec3be67d73a72a072453fe76e1d9377c
3
+ metadata.gz: f03a08553ec482fb91da2286be89cc37145e0e81
4
+ data.tar.gz: a4d3f94ea114748fb4ba6b34fc6131a263e7c9cf
5
5
  SHA512:
6
- metadata.gz: 0ff7db8e8c6767a7097cee40576ebb35e323190383698fb442a9f8a624d5ce49826a08461d02ceecea96e2ef393dd3ebb3b447cc617444e11efc9c31764b5f4a
7
- data.tar.gz: 881fc7b5c817fd10c06cb1eeec82b57db3abd67a5eb38b577f0e61a475cf65268c0c7e136260e1a7e300baca64031c9ff56491b8c5ac614da5c1a498f183fdcb
6
+ metadata.gz: ed9bc3f7c54053bd16a1c68b5cd7c98e15c65bfe75e617b1d1f45f880a07e900e260881460cd5e3a78a3f0bc2e1cccb75a88c626f21f091c5f419324fbc98daf
7
+ data.tar.gz: a5f9515876357e11d3609174854e0798dced45677463360ffcc2685c345a67010c5bdf624893ca2693b3bc8434540925647b6183373e8cd70ccf170a84bd6599
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.1
5
+ - 2.2
6
+
7
+ gemfile:
8
+ - Gemfile
9
+
10
+ script: bundle exec rake test
data/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  To generate 1 ping message per 60seconds(default):
13
13
 
14
14
  <source>
15
- type ping_message
15
+ @type ping_message
16
16
  </source>
17
17
  #=> tag: 'ping'
18
18
  # message: {'data' => 'your.hostname.local'}
@@ -20,7 +20,7 @@ To generate 1 ping message per 60seconds(default):
20
20
  Change ping message interval into 30 seconds, and fix `tag` and `data`:
21
21
 
22
22
  <source>
23
- type ping_message
23
+ @type ping_message
24
24
  tag ping.webserver
25
25
  interval 30
26
26
  data ping message from ${hostname}
@@ -30,10 +30,10 @@ Change ping message interval into 30 seconds, and fix `tag` and `data`:
30
30
 
31
31
  ### PingMessageCheckerOutput
32
32
 
33
- To receive ping messages and checks ping message in-arrival, use `type ping_message_checker`:
33
+ To receive ping messages and checks ping message in-arrival, use `@type ping_message_checker`:
34
34
 
35
35
  <match ping.**>
36
- type ping_message_checker
36
+ @type ping_message_checker
37
37
  tag missing.ping
38
38
  check_interval 3600 # 1hour by default
39
39
  notification_times 3 # 3 times by default
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-ping-message"
4
- gem.version = "0.1.2"
4
+ gem.version = "0.2.0"
5
5
  gem.authors = ["TAGOMORI Satoshi"]
6
6
  gem.email = ["tagomoris@gmail.com"]
7
7
  gem.description = %q{for heartbeat monitoring of Fluentd processes}
@@ -19,4 +19,5 @@ Gem::Specification.new do |gem|
19
19
  gem.add_development_dependency "rake"
20
20
  gem.add_development_dependency "pry"
21
21
  gem.add_development_dependency "pry-nav"
22
+ gem.add_development_dependency "test-unit", "~> 3"
22
23
  end
@@ -14,6 +14,11 @@ class Fluent::PingMessageInput < Fluent::Input
14
14
  config_param :interval, :integer, :default => 60
15
15
  config_param :data, :string, :default => `hostname`.chomp
16
16
 
17
+ # Define `router` method of v0.12 to support v0.10.57 or earlier
18
+ unless method_defined?(:router)
19
+ define_method("router") { Engine }
20
+ end
21
+
17
22
  def start
18
23
  super
19
24
  start_pingloop
@@ -35,7 +40,7 @@ class Fluent::PingMessageInput < Fluent::Input
35
40
  sleep 0.5
36
41
  if Fluent::Engine.now - @last_checked >= @interval
37
42
  @last_checked = Fluent::Engine.now
38
- Fluent::Engine.emit(@tag, Fluent::Engine.now, {'data' => @data})
43
+ router.emit(@tag, Fluent::Engine.now, {'data' => @data})
39
44
  end
40
45
  end
41
46
  end
@@ -8,6 +8,11 @@ class Fluent::PingMessageCheckerOutput < Fluent::Output
8
8
  define_method("log") { $log }
9
9
  end
10
10
 
11
+ # Define `router` method of v0.12 to support v0.10.57 or earlier
12
+ unless method_defined?(:router)
13
+ define_method("router") { Engine }
14
+ end
15
+
11
16
  config_param :data_field, :string, :default => 'data'
12
17
 
13
18
  config_param :tag, :string
@@ -83,7 +88,7 @@ class Fluent::PingMessageCheckerOutput < Fluent::Output
83
88
 
84
89
  if @notifications
85
90
  notifications.each do |data|
86
- Fluent::Engine.emit(@tag, Fluent::Engine.now, {@data_field => data})
91
+ router.emit(@tag, Fluent::Engine.now, {@data_field => data})
87
92
  end
88
93
  end
89
94
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-ping-message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: test-unit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3'
83
97
  description: for heartbeat monitoring of Fluentd processes
84
98
  email:
85
99
  - tagomoris@gmail.com
@@ -89,6 +103,7 @@ extra_rdoc_files: []
89
103
  files:
90
104
  - ".gitignore"
91
105
  - ".pryrc"
106
+ - ".travis.yml"
92
107
  - Gemfile
93
108
  - LICENSE.txt
94
109
  - README.md
@@ -118,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
133
  version: '0'
119
134
  requirements: []
120
135
  rubyforge_project:
121
- rubygems_version: 2.2.2
136
+ rubygems_version: 2.5.1
122
137
  signing_key:
123
138
  specification_version: 4
124
139
  summary: Fluentd plugin to send/check ping messages