fluent-plugin-yohoushi 0.0.4 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e938d9760ec8f7885633d08d9909f17274b9b42
4
- data.tar.gz: ea2a1c8be04c55d11c0b8a15bee8712fa8166b7e
3
+ metadata.gz: 0d33e56754f4290c20f7b06b38587f735fc86c2f
4
+ data.tar.gz: f5e963e6b9fa7bb2ff74c8c63d551906277da04f
5
5
  SHA512:
6
- metadata.gz: 57efe427de701f149cc1932cf0daab759c36ae18021a15f5f1a7a52fc4e192bc08225d942eae37f0a6920d6ce888ed09be649c267b958f7a775be193415cae84
7
- data.tar.gz: 2410dd562c892fee6ab12ec50c9f9c46542fd4f900ff0d3dde090ff433451e21372258a131516b208807b9cc1ace7d85e769040080daf369bd60d521c9a95966
6
+ metadata.gz: e7c1f30ae26ff1025657de6b2812a88e46785e510b69a3d0e98aca8a51065349a481c6551e23b643c4d6d6ec9db2e30218fcbd767ea89d50d4a7a64db9ac7a94
7
+ data.tar.gz: 667ae677f9de049f407561f5425c945748189581b53bd65282fac15546c261150658d2af240994519a4838c06db0650e155e384e5690799d08d23cbee62f1515
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.5 (2014/01/25)
2
+
3
+ Fixes:
4
+
5
+ * Fix ${time} placeholder
6
+
1
7
  ## 0.0.4 (2014/01/25)
2
8
 
3
9
  Enhancement:
@@ -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-yohoushi"
6
- s.version = "0.0.4"
6
+ s.version = "0.0.5"
7
7
  s.authors = ["Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/sonots/fluent-plugin-yohoushi"
@@ -170,7 +170,7 @@ class Fluent::YohoushiOutput < Fluent::Output
170
170
  attr_reader :placeholders
171
171
 
172
172
  def prepare_placeholders(time, record, opts)
173
- placeholders = { '${time}' => time.to_s }
173
+ placeholders = { '${time}' => Time.at(time).to_s }
174
174
  record.each {|key, val| placeholders.store("${#{key}}", val) }
175
175
 
176
176
  opts.each do |key, val|
@@ -206,7 +206,7 @@ class Fluent::YohoushiOutput < Fluent::Output
206
206
  # @param [Hash] opts others
207
207
  def prepare_placeholders(time, record, opts)
208
208
  struct = UndefOpenStruct.new(record)
209
- struct.time = time
209
+ struct.time = Time.at(time)
210
210
  opts.each {|key, val| struct.__send__("#{key}=", val) }
211
211
  @placeholders = struct
212
212
  end
@@ -145,14 +145,14 @@ describe Fluent::YohoushiOutput do
145
145
  let(:time) { Time.now.to_i }
146
146
  let(:record) { { 'foo_count' => "1" } }
147
147
  let(:emit) { driver.run { driver.emit(record, time) } }
148
- let(:expected_path) { '/fluent/error/fluent.error/1/foo_count' }
148
+ let(:expected_path) { "/fluent/error/fluent.error/1/foo_count/#{Time.at(time)}" }
149
149
  let(:expected_value) { '1' }
150
150
  before { driver.instance.should_receive(:post).with(expected_path, expected_value) }
151
151
 
152
152
  context 'keyN' do
153
153
  let(:config) {%[
154
154
  mapping1 / http://foobar
155
- key1 foo_count /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${CGI.unescape(key)}
155
+ key1 foo_count /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${CGI.unescape(key)}/${time}
156
156
  enable_ruby true
157
157
  ]}
158
158
  it { emit }
@@ -161,7 +161,7 @@ describe Fluent::YohoushiOutput do
161
161
  context 'key_pattern' do
162
162
  let(:config) {%[
163
163
  mapping1 / http://foobar
164
- key_pattern _count$ /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${URI.unescape(key)}
164
+ key_pattern _count$ /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${URI.unescape(key)}/${time.to_s}
165
165
  enable_ruby true
166
166
  ]}
167
167
  it { emit }
@@ -174,14 +174,14 @@ describe Fluent::YohoushiOutput do
174
174
  let(:time) { Time.now.to_i }
175
175
  let(:record) { { 'foo_count' => "1" } }
176
176
  let(:emit) { driver.run { driver.emit(record, time) } }
177
- let(:expected_path) { '/fluent/error/fluent.error/1/foo_count' }
177
+ let(:expected_path) { "/fluent/error/fluent.error/1/foo_count/#{Time.at(time)}" }
178
178
  let(:expected_value) { '1' }
179
179
  before { driver.instance.should_receive(:post).with(expected_path, expected_value) }
180
180
 
181
181
  context 'keyN' do
182
182
  let(:config) {%[
183
183
  mapping1 / http://foobar
184
- key1 foo_count /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}
184
+ key1 foo_count /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}/${time}
185
185
  enable_ruby false
186
186
  ]}
187
187
  it { emit }
@@ -190,7 +190,7 @@ describe Fluent::YohoushiOutput do
190
190
  context 'key_pattern' do
191
191
  let(:config) {%[
192
192
  mapping1 / http://foobar
193
- key_pattern _count$ /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}
193
+ key_pattern _count$ /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}/${time}
194
194
  enable_ruby false
195
195
  ]}
196
196
  it { emit }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-yohoushi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo