fluentd 0.10.59 → 0.10.60

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 434f3deef039256104205794d09c06668a82e8c4
4
- data.tar.gz: 296981ab483797547447a60ce944987be7ff7431
3
+ metadata.gz: df3b9d78b6f1c9a907dd128b49c515c5a4900fd1
4
+ data.tar.gz: 5275b1852cc3c2f77a94583bfe51b4754ccfce4c
5
5
  SHA512:
6
- metadata.gz: 1f5cd6aef58345917d17e5ab6560d610954eba3f3043cad59d9a446f5b4aa4964e2d118e94a9b1be31610558fba1cccb74430fda55eb9e1e8744b6afee865af8
7
- data.tar.gz: 2e6a4d27834b6cff8f8b7efe1cb1da480f935dd2e958f78aec5ded158e490216e311bcfc40437cf4caeba01248b88c4be4825dfd8f1ca36ba5673a4079f2209f
6
+ metadata.gz: 73feb1d33087e5f92d0131f2dbd39ac379d6bc513869ced303b77bba2a1854d5ccf828cf9f5f8b38e403058e3f001b44effd18b4f16ffca2a54f96f012ac76e0
7
+ data.tar.gz: cb62b6f2bd879db66d00d17d59f44d9d8831a9d9c582c46721fecdab650cf8ae6b843f4e8cdcb1a88ceafd67c3f5aa44e28f0267738ba5db4781c33ef9a1e627
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ Release 0.10.60 - 2014/02/06
2
+
3
+ * in_tail: Enable multiline mode if format contains 'multiline'
4
+ * event: Improve EventStream#to_msgpack_stream performance
5
+ * engine: Add tag information emit log
6
+ * Update msgpack dependency to avoid incompatible encoding problem
7
+
1
8
  Release 0.10.59 - 2014/01/23
2
9
 
3
10
  * in_tail: Support 64bit inode environment in in_tail
@@ -18,7 +18,8 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.required_ruby_version = '>= 1.9.3'
20
20
 
21
- gem.add_runtime_dependency("msgpack", [">= 0.4.4", "!= 0.5.0", "!= 0.5.1", "!= 0.5.2", "!= 0.5.3", "< 0.6.0"])
21
+ gem.add_runtime_dependency("msgpack", [">= 0.4.4", "!= 0.5.0", "!= 0.5.1", "!= 0.5.2", "!= 0.5.3", "!= 0.5.4",
22
+ "!= 0.5.5", "!= 0.5.6", "!= 0.5.7", "!= 0.5.8", "!= 0.5.9", "!= 0.5.10", "< 0.6.0"])
22
23
  gem.add_runtime_dependency("json", [">= 1.4.3"])
23
24
  gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
24
25
  gem.add_runtime_dependency("cool.io", [">= 1.1.1", "!= 1.2.0", "< 2.0.0"])
@@ -160,7 +160,7 @@ module Fluent
160
160
  target.emit(tag, es)
161
161
  rescue => e
162
162
  if @suppress_emit_error_log_interval == 0 || now > @next_emit_error_log_time
163
- $log.warn "emit transaction failed ", :error_class=>e.class, :error=>e
163
+ $log.warn "emit transaction failed ", :error_class=>e.class, :error=>e, :tag=>tag
164
164
  $log.warn_backtrace
165
165
  # $log.debug "current next_emit_error_log_time: #{Time.at(@next_emit_error_log_time)}"
166
166
  @next_emit_error_log_time = Time.now.to_i + @suppress_emit_error_log_interval
@@ -28,11 +28,11 @@ module Fluent
28
28
  end
29
29
 
30
30
  def to_msgpack_stream
31
- out = ''
31
+ out = $use_msgpack_5 ? MessagePack::Buffer.new : ''.force_encoding('ASCII-8BIT')
32
32
  each {|time,record|
33
33
  [time,record].to_msgpack(out)
34
34
  }
35
- out
35
+ out.to_s
36
36
  end
37
37
  end
38
38
 
@@ -67,7 +67,7 @@ module Fluent
67
67
  end
68
68
 
69
69
  def dup
70
- entries = @entries.map(:dup)
70
+ entries = @entries.map { |entry| entry.dup } # @entries.map(:dup) doesn't work by ArgumentError
71
71
  ArrayEventStream.new(entries)
72
72
  end
73
73
 
@@ -50,7 +50,7 @@ module Fluent
50
50
  configure_parser(conf)
51
51
  configure_tag
52
52
 
53
- @multiline_mode = conf['format'] == 'multiline'
53
+ @multiline_mode = conf['format'] =~ /multiline/
54
54
  @receive_handler = if @multiline_mode
55
55
  method(:parse_multilines)
56
56
  else
@@ -1,5 +1,5 @@
1
1
  module Fluent
2
2
 
3
- VERSION = '0.10.59'
3
+ VERSION = '0.10.60'
4
4
 
5
5
  end
@@ -0,0 +1,168 @@
1
+ require_relative 'helper'
2
+ require 'fluent/test'
3
+ require 'fluent/event'
4
+
5
+ module EventTest
6
+ class OneEventStreamTest < ::Test::Unit::TestCase
7
+ include Fluent
8
+
9
+ def setup
10
+ @time = Engine.now
11
+ @record = {'k' => 'v', 'n' => 1}
12
+ @es = OneEventStream.new(@time, @record)
13
+ end
14
+
15
+ test 'repeatable?' do
16
+ assert_true @es.repeatable?
17
+ end
18
+
19
+ test 'dup' do
20
+ dupped = @es.dup
21
+ assert_kind_of OneEventStream, dupped
22
+ assert_not_equal @es.object_id, dupped.object_id
23
+ end
24
+
25
+ test 'each' do
26
+ @es.each { |time, record|
27
+ assert_equal @time, time
28
+ assert_equal @record, record
29
+ }
30
+ end
31
+
32
+ test 'to_msgpack_stream' do
33
+ stream = @es.to_msgpack_stream
34
+ MessagePack::Unpacker.new.feed_each(stream) { |time, record|
35
+ assert_equal @time, time
36
+ assert_equal @record, record
37
+ }
38
+ end
39
+ end
40
+
41
+ class ArrayEventStreamTest < ::Test::Unit::TestCase
42
+ include Fluent
43
+
44
+ def setup
45
+ @times = [Engine.now, Engine.now + 1]
46
+ @records = [{'k' => 'v1', 'n' => 1}, {'k' => 'v2', 'n' => 2}]
47
+ @es = ArrayEventStream.new(@times.zip(@records))
48
+ end
49
+
50
+ test 'repeatable?' do
51
+ assert_true @es.repeatable?
52
+ end
53
+
54
+ test 'dup' do
55
+ dupped = @es.dup
56
+ assert_kind_of ArrayEventStream, dupped
57
+ assert_not_equal @es.object_id, dupped.object_id
58
+ end
59
+
60
+ test 'empty?' do
61
+ assert_not_empty @es
62
+ assert_true ArrayEventStream.new([]).empty?
63
+ end
64
+
65
+ test 'each' do
66
+ i = 0
67
+ @es.each { |time, record|
68
+ assert_equal @times[i], time
69
+ assert_equal @records[i], record
70
+ i += 1
71
+ }
72
+ end
73
+
74
+ test 'to_msgpack_stream' do
75
+ i = 0
76
+ stream = @es.to_msgpack_stream
77
+ MessagePack::Unpacker.new.feed_each(stream) { |time, record|
78
+ assert_equal @times[i], time
79
+ assert_equal @records[i], record
80
+ i += 1
81
+ }
82
+ end
83
+ end
84
+
85
+ class MultiEventStreamTest < ::Test::Unit::TestCase
86
+ include Fluent
87
+
88
+ def setup
89
+ @times = [Engine.now, Engine.now + 1]
90
+ @records = [{'k' => 'v1', 'n' => 1}, {'k' => 'v2', 'n' => 2}]
91
+ @es = MultiEventStream.new
92
+ @times.zip(@records).each { |time, record|
93
+ @es.add(time, record)
94
+ }
95
+ end
96
+
97
+ test 'repeatable?' do
98
+ assert_true @es.repeatable?
99
+ end
100
+
101
+ test 'dup' do
102
+ dupped = @es.dup
103
+ assert_kind_of MultiEventStream, dupped
104
+ assert_not_equal @es.object_id, dupped.object_id
105
+ end
106
+
107
+ test 'empty?' do
108
+ assert_not_empty @es
109
+ assert_true MultiEventStream.new.empty?
110
+ end
111
+
112
+ test 'each' do
113
+ i = 0
114
+ @es.each { |time, record|
115
+ assert_equal @times[i], time
116
+ assert_equal @records[i], record
117
+ i += 1
118
+ }
119
+ end
120
+
121
+ test 'to_msgpack_stream' do
122
+ i = 0
123
+ stream = @es.to_msgpack_stream
124
+ MessagePack::Unpacker.new.feed_each(stream) { |time, record|
125
+ assert_equal @times[i], time
126
+ assert_equal @records[i], record
127
+ i += 1
128
+ }
129
+ end
130
+ end
131
+
132
+ class MessagePackEventStreamTest < ::Test::Unit::TestCase
133
+ include Fluent
134
+
135
+ def setup
136
+ out = ''.force_encoding('ASCII-8BIT')
137
+ @times = [Engine.now, Engine.now + 1]
138
+ @records = [{'k' => 'v1', 'n' => 1}, {'k' => 'v2', 'n' => 2}]
139
+ @times.zip(@records).each { |time, record|
140
+ out << MessagePack.pack([time, record])
141
+ }
142
+ @es = MessagePackEventStream.new(out)
143
+ end
144
+
145
+ test 'repeatable?' do
146
+ assert_true @es.repeatable?
147
+ end
148
+
149
+ test 'each' do
150
+ i = 0
151
+ @es.each { |time, record|
152
+ assert_equal @times[i], time
153
+ assert_equal @records[i], record
154
+ i += 1
155
+ }
156
+ end
157
+
158
+ test 'to_msgpack_stream' do
159
+ i = 0
160
+ stream = @es.to_msgpack_stream
161
+ MessagePack::Unpacker.new.feed_each(stream) { |time, record|
162
+ assert_equal @times[i], time
163
+ assert_equal @records[i], record
164
+ i += 1
165
+ }
166
+ end
167
+ end
168
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.59
4
+ version: 0.10.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -29,6 +29,27 @@ dependencies:
29
29
  - - "!="
30
30
  - !ruby/object:Gem::Version
31
31
  version: 0.5.3
32
+ - - "!="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.5.4
35
+ - - "!="
36
+ - !ruby/object:Gem::Version
37
+ version: 0.5.5
38
+ - - "!="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.6
41
+ - - "!="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.5.7
44
+ - - "!="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.5.8
47
+ - - "!="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.5.9
50
+ - - "!="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.5.10
32
53
  - - "<"
33
54
  - !ruby/object:Gem::Version
34
55
  version: 0.6.0
@@ -51,6 +72,27 @@ dependencies:
51
72
  - - "!="
52
73
  - !ruby/object:Gem::Version
53
74
  version: 0.5.3
75
+ - - "!="
76
+ - !ruby/object:Gem::Version
77
+ version: 0.5.4
78
+ - - "!="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.5.5
81
+ - - "!="
82
+ - !ruby/object:Gem::Version
83
+ version: 0.5.6
84
+ - - "!="
85
+ - !ruby/object:Gem::Version
86
+ version: 0.5.7
87
+ - - "!="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.5.8
90
+ - - "!="
91
+ - !ruby/object:Gem::Version
92
+ version: 0.5.9
93
+ - - "!="
94
+ - !ruby/object:Gem::Version
95
+ version: 0.5.10
54
96
  - - "<"
55
97
  - !ruby/object:Gem::Version
56
98
  version: 0.6.0
@@ -406,6 +448,7 @@ files:
406
448
  - test/scripts/fluent/plugin/parser_known.rb
407
449
  - test/test_config.rb
408
450
  - test/test_configdsl.rb
451
+ - test/test_event.rb
409
452
  - test/test_formatter.rb
410
453
  - test/test_input.rb
411
454
  - test/test_match.rb
@@ -479,6 +522,7 @@ test_files:
479
522
  - test/scripts/fluent/plugin/parser_known.rb
480
523
  - test/test_config.rb
481
524
  - test/test_configdsl.rb
525
+ - test/test_event.rb
482
526
  - test/test_formatter.rb
483
527
  - test/test_input.rb
484
528
  - test/test_match.rb