fluent-plugin-memcached 0.1.0 → 0.1.1

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: 04bdd171af2653d194e71653ef1cde7b3f5d8eac
4
- data.tar.gz: 7bc7d5f2c588e61462fa79f27c8bdcb8ac478552
3
+ metadata.gz: 369bfe5ecc11048b67015f77bcfe16e78a033aae
4
+ data.tar.gz: 00a867ad20989e5ef7c1c1134a87813de1bd52ea
5
5
  SHA512:
6
- metadata.gz: a52eb5e76a3feb31c8f6e9410c9ea3c1f463150a7ff2a8a3ce1e64d15746bfb05d65410575b4ef3bed7d7a08890ccfee1826b4b32a9db5f6aa7e934873b4568d
7
- data.tar.gz: f4763100a95b54f8d2101f20862e0a5dc766aa5446f1b3d0e0a2dc8c1a49a07af2056dc19a68933a2432ea84783275f51829b377d7b749b9f287952415427e79
6
+ metadata.gz: 916fe9ccbfca3577f64599d285b28a4be8ed1e2efdf6054d427a6dee870ae1a052c94a2e6fd35eda25a2302bf69a119a3ffb01fd58ab804d9304e865dbe7c386
7
+ data.tar.gz: 949d12468856097b688f26e07cc9131171bccce332d4bfd0a436909ce0a8bb990e95c22b92e8c2f995a3062b571a3f49528e585073124374fa510cdf0c7195ea
@@ -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.1.0"
7
+ gem.version = "0.1.1"
8
8
  gem.authors = ["innossh"]
9
9
  gem.email = ["innossh@users.noreply.github.com"]
10
10
 
@@ -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
- [tag, time, record].to_msgpack
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 { |tag, time, record|
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 [['test', time, record].to_msgpack], d.formatted
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd