fluent-plugin-keep-forward 0.0.1 → 0.0.2
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/README.md +1 -1
- data/fluent-plugin-keep-forward.gemspec +1 -1
- data/lib/fluent/plugin/out_keep_forward.rb +2 -2
- data/spec/out_keep_forward_spec.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f10f73e8154ccb5716a6ba59aa073b6416b71eb
|
4
|
+
data.tar.gz: c959a4ba8f30e742a80e4ffd3054bfe1c43f2128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb54fc3ab78d78fb674a63ca5f16d967c7415d7cc45e652db19e9075984e9518e5d4b06db78efec61f83412f43c716b255f45312d05ffc7d88abfe63405f3dcc
|
7
|
+
data.tar.gz: 1ff41396c9a3329f37f142f8138844be7ba79d80b419cde5b3f3b9b3dcd7d0c0d7d693d2f4e20ce308e50d0c9481f514f67b9512cbe15ceddb570c2f0b05e501
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ This plugin outputs log messages like
|
|
17
17
|
$ grep 'keep forwarding' /var/log/td-agent/td-agent.log
|
18
18
|
2013-03-15 10:35:06 +0900: keep forwarding tag 'fluent.info' to node 'localhost:24224' host="localhost" port=24224 weight=60
|
19
19
|
|
20
|
-
You can tell the address of forwarding node easily.
|
20
|
+
You can tell the address of current forwarding node easily.
|
21
21
|
|
22
22
|
## Contributing
|
23
23
|
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-keep-forward"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.2"
|
7
7
|
s.authors = ["Naotoshi SEO"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-keep-forward"
|
@@ -29,7 +29,7 @@ class Fluent::KeepForwardOutput < Fluent::ForwardOutput
|
|
29
29
|
begin
|
30
30
|
send_data(node, tag, es)
|
31
31
|
@node[tag] = node
|
32
|
-
$log.info "keep forwarding tag '#{tag}' to node '#{node.name}'", :host=>node.host, :port=>node.port, :weight=>node.weight
|
32
|
+
# $log.info "keep forwarding tag '#{tag}' to node '#{node.name}'", :host=>node.host, :port=>node.port, :weight=>node.weight
|
33
33
|
return
|
34
34
|
rescue
|
35
35
|
# for load balancing during detecting crashed servers
|
@@ -39,7 +39,7 @@ class Fluent::KeepForwardOutput < Fluent::ForwardOutput
|
|
39
39
|
end
|
40
40
|
|
41
41
|
@node[tag] = nil
|
42
|
-
$log.info "keep forwarding tag '#{tag}' is lost"
|
42
|
+
# $log.info "keep forwarding tag '#{tag}' is lost"
|
43
43
|
if error
|
44
44
|
raise error
|
45
45
|
else
|
@@ -35,30 +35,31 @@ end
|
|
35
35
|
describe Fluent::KeepForwardOutput do
|
36
36
|
include_context 'keep_forward_init'
|
37
37
|
include_context 'keep_forward_try_once'
|
38
|
+
before { driver.should_receive(:send_data).with(target, tag, es) } # mock
|
38
39
|
|
39
40
|
describe 'keep forwarding if no problem?' do
|
40
|
-
|
41
|
+
let(:target) { keep_node }
|
41
42
|
it { driver.write_objects(tag, es) }
|
42
43
|
end
|
43
44
|
|
44
45
|
describe 'switch if not available?' do
|
45
46
|
before { keep_node.available = false }
|
46
47
|
|
47
|
-
|
48
|
+
let(:target) { unkeep_node }
|
48
49
|
it { driver.write_objects(tag, es) }
|
49
50
|
end
|
50
51
|
|
51
52
|
describe 'switch if not included in weight_array?' do
|
52
53
|
before { driver.instance_variable_set(:@weight_array, [unkeep_node]) }
|
53
54
|
|
54
|
-
|
55
|
+
let(:target) { unkeep_node }
|
55
56
|
it { driver.write_objects(tag, es) }
|
56
57
|
end
|
57
58
|
|
58
59
|
describe 'switch if send_data to keep_node raises?' do
|
59
60
|
before { driver.stub(:send_data).with(keep_node, tag, es).and_raise(StandardError) }
|
60
61
|
|
61
|
-
|
62
|
+
let(:target) { unkeep_node }
|
62
63
|
it { driver.write_objects(tag, es) }
|
63
64
|
end
|
64
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-keep-forward
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi SEO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|