fluent-plugin-memcached 0.0.2 → 0.0.3

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: 1251fe26e9597697c7c869e712a1c67a8682b456
4
- data.tar.gz: 81d80c179d2243e3265d4c5e37dddd6dfaadd16f
3
+ metadata.gz: 20b0d5030e01eaae83f5b3a21011a4d77c94bc5e
4
+ data.tar.gz: 9b0bfa668bea56f544512a8a3e830b8f235eabcf
5
5
  SHA512:
6
- metadata.gz: 50950f5f43741f0963bbb980be335a85ad196484eaba059e636da385a6339f550ff33351d42f3f9181698f63ee5ad4a3ae17234b1336226bbfd36a53de18b2c7
7
- data.tar.gz: 8976bf61bf9da88dfeddf566669b86a7ac5da6597d4f52b88cee8c5eef1bc62de8426cebd33c9a646859799da47046475ea4a9554a5ac6838e8e11df66b76fcd
6
+ metadata.gz: 6c580fc988229472195cfccbd0782230ff36b436a9fdf4b0f4b3b04f263da269503b3a3b4e24fb912d79d4637c02db57eb41e7dac0878852406feadc8058c08d
7
+ data.tar.gz: d5217725bf430a35617a4ce66cc2d959d86c58168e7f975b418b40e9d6752e7a9c0b67a575ad59b183f3335127e5d394d80b9b4dc127a4e49d7651082f88e862
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-memcached"
7
- gem.version = "0.0.2"
7
+ gem.version = "0.0.3"
8
8
  gem.authors = ["innossh"]
9
9
  gem.email = ["innossh@users.noreply.github.com"]
10
10
 
@@ -27,10 +27,9 @@ class Fluent::MemcachedOutput < Fluent::BufferedOutput
27
27
  end
28
28
 
29
29
  def write(chunk)
30
- chunk.msgpack_each { |tag, time, data|
31
- array = data.kind_of?(Array) ? data : data.split(' ');
32
- key = array.first
33
- value = array.drop(1).join(' ')
30
+ chunk.msgpack_each { |tag, time, record|
31
+ key = record.values.first
32
+ value = record.values.drop(1).join(' ')
34
33
  @memcached.set key, value
35
34
  }
36
35
  end
@@ -31,19 +31,22 @@ class MemcachedOutputTest < Test::Unit::TestCase
31
31
  def test_format
32
32
  d = create_driver
33
33
  time = Time.parse('2011-01-02 13:14:15 UTC').to_i
34
- d.emit('a 1', time)
35
- d.expect_format(['test', time, 'a 1'].to_msgpack)
34
+ record = { 'key' => 'key', 'value1' => 'value' }
35
+ d.emit(record, time)
36
+ d.expect_format(['test', time, record].to_msgpack)
36
37
  d.run
37
38
  end
38
39
 
39
40
  def test_write
40
41
  d = create_driver
41
42
  time = Time.parse('2011-01-02 13:14:15 UTC').to_i
42
- d.emit('a 1', time)
43
- d.emit(%w(b 2), time)
43
+ record1 = { 'key' => 'a', 'value1' => '1' }
44
+ record2 = { 'key' => 'b', 'value1' => '2', 'value2' => '3' }
45
+ d.emit(record1, time)
46
+ d.emit(record2, time)
44
47
  d.run
45
48
 
46
49
  assert_equal '1', d.instance.memcached.get('a')
47
- assert_equal '2', d.instance.memcached.get('b')
50
+ assert_equal '2 3', d.instance.memcached.get('b')
48
51
  end
49
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - innossh