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 +4 -4
- data/fluent-plugin-memcached.gemspec +1 -1
- data/lib/fluent/plugin/out_memcached.rb +3 -4
- data/test/plugin/test_out_memcached.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b0d5030e01eaae83f5b3a21011a4d77c94bc5e
|
4
|
+
data.tar.gz: 9b0bfa668bea56f544512a8a3e830b8f235eabcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c580fc988229472195cfccbd0782230ff36b436a9fdf4b0f4b3b04f263da269503b3a3b4e24fb912d79d4637c02db57eb41e7dac0878852406feadc8058c08d
|
7
|
+
data.tar.gz: d5217725bf430a35617a4ce66cc2d959d86c58168e7f975b418b40e9d6752e7a9c0b67a575ad59b183f3335127e5d394d80b9b4dc127a4e49d7651082f88e862
|
@@ -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,
|
31
|
-
|
32
|
-
|
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
|
-
|
35
|
-
d.
|
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
|
-
|
43
|
-
|
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
|