fluent-plugin-memcached 0.1.0 → 0.1.1
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 +11 -2
- data/test/plugin/test_out_memcached.rb +1 -1
- 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: 369bfe5ecc11048b67015f77bcfe16e78a033aae
|
4
|
+
data.tar.gz: 00a867ad20989e5ef7c1c1134a87813de1bd52ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916fe9ccbfca3577f64599d285b28a4be8ed1e2efdf6054d427a6dee870ae1a052c94a2e6fd35eda25a2302bf69a119a3ffb01fd58ab804d9304e865dbe7c386
|
7
|
+
data.tar.gz: 949d12468856097b688f26e07cc9131171bccce332d4bfd0a436909ce0a8bb990e95c22b92e8c2f995a3062b571a3f49528e585073124374fa510cdf0c7195ea
|
@@ -4,6 +4,10 @@ require 'fluent/plugin/output'
|
|
4
4
|
class Fluent::Plugin::MemcachedOutput < Fluent::Plugin::Output
|
5
5
|
Fluent::Plugin.register_output('memcached', self)
|
6
6
|
|
7
|
+
helpers :compat_parameters
|
8
|
+
|
9
|
+
DEFAULT_BUFFER_TYPE = "memory"
|
10
|
+
|
7
11
|
config_param :host, :string, :default => 'localhost'
|
8
12
|
config_param :port, :integer, :default => 11211
|
9
13
|
|
@@ -13,10 +17,15 @@ class Fluent::Plugin::MemcachedOutput < Fluent::Plugin::Output
|
|
13
17
|
config_param :value_format, :string, :default => 'raw'
|
14
18
|
config_param :param_names, :string, :default => nil # nil doesn't allowed for json
|
15
19
|
|
20
|
+
config_section :buffer do
|
21
|
+
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
22
|
+
end
|
23
|
+
|
16
24
|
attr_accessor :memcached
|
17
25
|
attr_accessor :formatter
|
18
26
|
|
19
27
|
def configure(conf)
|
28
|
+
compat_parameters_convert(conf, :buffer)
|
20
29
|
super
|
21
30
|
if @value_format == 'json' and @param_names.nil?
|
22
31
|
raise Fluent::ConfigError, "param_names MUST be specified in the case of json format"
|
@@ -35,7 +44,7 @@ class Fluent::Plugin::MemcachedOutput < Fluent::Plugin::Output
|
|
35
44
|
end
|
36
45
|
|
37
46
|
def format(tag, time, record)
|
38
|
-
[
|
47
|
+
[time, record].to_msgpack
|
39
48
|
end
|
40
49
|
|
41
50
|
def formatted_to_msgpack_binary?
|
@@ -47,7 +56,7 @@ class Fluent::Plugin::MemcachedOutput < Fluent::Plugin::Output
|
|
47
56
|
end
|
48
57
|
|
49
58
|
def write(chunk)
|
50
|
-
chunk.msgpack_each { |
|
59
|
+
chunk.msgpack_each { |time, record|
|
51
60
|
key = @formatter.key(record)
|
52
61
|
value = @formatter.value(record)
|
53
62
|
if @increment
|
@@ -82,7 +82,7 @@ class MemcachedOutputTest < Test::Unit::TestCase
|
|
82
82
|
d.run(default_tag: 'test') do
|
83
83
|
d.feed(time, record)
|
84
84
|
end
|
85
|
-
assert_equal [[
|
85
|
+
assert_equal [[time, record].to_msgpack], d.formatted
|
86
86
|
end
|
87
87
|
|
88
88
|
def test_write
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-memcached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- innossh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|