fluent-plugin-kestrel 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ source "http://rubygems.org"
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
9
  gem "shoulda", ">= 0"
10
- gem "bundler", "~> 1.0.0"
10
+ gem "bundler", ">= 1.0.0"
11
11
  gem "rdoc", "~> 3.12"
12
12
  gem "jeweler", "~> 1.8.3"
13
13
  gem "rcov", ">= 0" if RUBY_VERSION < "1.9.0"
@@ -8,6 +8,10 @@ see https://github.com/fluent/fluentd
8
8
  kestrel is a simple, distributed message queue.
9
9
  see https://github.com/robey/kestrel
10
10
 
11
+ == Installation
12
+
13
+ gem install fluent-plugin-kestrel
14
+
11
15
  == Fluentd Configuration
12
16
 
13
17
  <match kestrel.**>
@@ -19,6 +23,24 @@ see https://github.com/robey/kestrel
19
23
  port 22133 # optional, default 22133
20
24
  </match>
21
25
 
26
+ == Data Format
27
+
28
+ [time]\t[tag]\t[resource(JSON)]
29
+
30
+ you can see its data format like so:
31
+ $ telnet localhost 22133
32
+
33
+ get test
34
+
35
+ VALUE test 0 125
36
+ 2012-02-11T16:38:54Z apache.access {"host":"::1","user":"-","method":"GET","path":"/test/","code":"304","size":"-"}
37
+ END
38
+
39
+
40
+ == ToDo
41
+
42
+ Data format customizable.
43
+
22
44
 
23
45
  == Contributing to fluent-plugin-kestrel
24
46
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fluent-plugin-kestrel"
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Junichiro Takagi"]
12
- s.date = "2012-02-11"
12
+ s.date = "2012-05-20"
13
13
  s.description = "fluentd output plugin for kestrel queue."
14
14
  s.email = "t.junichiro@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.homepage = "http://github.com/tjun/fluent-plugin-kestrel"
32
32
  s.licenses = ["Apache License, Version 2.0"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = "1.8.15"
34
+ s.rubygems_version = "1.8.24"
35
35
  s.summary = "fluentd output plugin for kestrel."
36
36
 
37
37
  if s.respond_to? :specification_version then
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  s.add_runtime_dependency(%q<kestrel-client>, [">= 0.7.1"])
42
42
  s.add_runtime_dependency(%q<fluentd>, [">= 0.10.10"])
43
43
  s.add_development_dependency(%q<shoulda>, [">= 0"])
44
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
44
+ s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
45
45
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
46
46
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
47
47
  s.add_development_dependency(%q<simplecov>, [">= 0.3.5"])
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
50
50
  s.add_dependency(%q<kestrel-client>, [">= 0.7.1"])
51
51
  s.add_dependency(%q<fluentd>, [">= 0.10.10"])
52
52
  s.add_dependency(%q<shoulda>, [">= 0"])
53
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
53
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
54
54
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
55
55
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
56
56
  s.add_dependency(%q<simplecov>, [">= 0.3.5"])
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  s.add_dependency(%q<kestrel-client>, [">= 0.7.1"])
61
61
  s.add_dependency(%q<fluentd>, [">= 0.10.10"])
62
62
  s.add_dependency(%q<shoulda>, [">= 0"])
63
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
63
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
64
64
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
65
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
66
66
  s.add_dependency(%q<simplecov>, [">= 0.3.5"])
@@ -7,7 +7,7 @@ module Fluent
7
7
  config_param :port, :integer, :default => 22133
8
8
  config_param :queue, :string, :default => nil
9
9
  config_param :ttl, :integer, :default => 0
10
- config_param :raw, :bool, :default => false
10
+ config_param :raw, :bool, :default => true
11
11
  config_param :time_format, :string, :default => nil
12
12
 
13
13
 
@@ -45,13 +45,13 @@ module Fluent
45
45
  chunk.open { |io|
46
46
  begin
47
47
  MessagePack::Unpacker.new(io).each{ |tag, time, record|
48
- time_str = @timef.format(time)
48
+ time_str = @timef.format(time)
49
49
  data = "#{time_str}\t#{tag}\t#{record.to_json}"
50
-
50
+
51
51
  @kestrel.set(@queue, data, ttl=@ttl, raw=@raw)
52
52
  }
53
53
  rescue EOFError
54
- # EOFError always occured when reached end of chunk.
54
+ # EOFError always occured when reached end of chunk.
55
55
  end
56
56
  }
57
57
  end
@@ -10,7 +10,7 @@ class TestFluentPluginKestrel < Test::Unit::TestCase
10
10
  type kestrel
11
11
  host localhost
12
12
  port 22133
13
- queue test
13
+ queue fluent-test
14
14
  ]
15
15
 
16
16
  def create_driver(conf = CONFIG)
@@ -22,12 +22,13 @@ class TestFluentPluginKestrel < Test::Unit::TestCase
22
22
  type kestrel
23
23
  host localhost
24
24
  port 22133
25
- queue test
25
+ queue fluent-test
26
26
  ])
27
27
 
28
28
  assert_equal 'localhost', d.instance.host
29
29
  assert_equal 22133, d.instance.port
30
- assert_equal "test", d.instance.queue
30
+ assert_equal "fluent-test", d.instance.queue
31
+
31
32
  end
32
33
 
33
34
  def test_format
@@ -48,11 +49,11 @@ class TestFluentPluginKestrel < Test::Unit::TestCase
48
49
  d.emit({"a"=>3}, time)
49
50
  d.run
50
51
 
51
- assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":1}", d.instance.kestrel.get("test")
52
- assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":2}", d.instance.kestrel.get("test")
53
- assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":3}", d.instance.kestrel.get("test")
54
-
55
-
52
+ get_opt = { :raw => true }.freeze
53
+
54
+ assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":1}", d.instance.kestrel.get("fluent-test", opts=get_opt)
55
+ assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":2}", d.instance.kestrel.get("fluent-test", opts=get_opt)
56
+ assert_equal "2011-01-02T13:14:15Z\ttest\t{\"a\":3}", d.instance.kestrel.get("fluent-test", opts=get_opt)
56
57
 
57
58
  end
58
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kestrel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-11 00:00:00.000000000Z
12
+ date: 2012-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: kestrel-client
16
- requirement: &70152932627300 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.7.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70152932627300
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.7.1
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: fluentd
27
- requirement: &70152932624980 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 0.10.10
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70152932624980
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.10.10
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: shoulda
38
- requirement: &70152932623080 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,21 +53,31 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70152932623080
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: bundler
49
- requirement: &70152932621340 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
- - - ~>
67
+ - - ! '>='
53
68
  - !ruby/object:Gem::Version
54
69
  version: 1.0.0
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70152932621340
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.0.0
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rdoc
60
- requirement: &70152932619720 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '3.12'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70152932619720
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '3.12'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: jeweler
71
- requirement: &70152932617180 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ~>
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 1.8.3
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70152932617180
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.8.3
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: simplecov
82
- requirement: &70152932615540 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: 0.3.5
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70152932615540
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.3.5
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: simplecov-rcov
93
- requirement: &70152932614040 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,7 +133,12 @@ dependencies:
98
133
  version: '0'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *70152932614040
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
102
142
  description: fluentd output plugin for kestrel queue.
103
143
  email: t.junichiro@gmail.com
104
144
  executables: []
@@ -132,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
172
  version: '0'
133
173
  segments:
134
174
  - 0
135
- hash: 391376077064872023
175
+ hash: 3129241088669939202
136
176
  required_rubygems_version: !ruby/object:Gem::Requirement
137
177
  none: false
138
178
  requirements:
@@ -141,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
181
  version: '0'
142
182
  requirements: []
143
183
  rubyforge_project:
144
- rubygems_version: 1.8.15
184
+ rubygems_version: 1.8.24
145
185
  signing_key:
146
186
  specification_version: 3
147
187
  summary: fluentd output plugin for kestrel.