fluent-plugin-mongo 0.6.11 → 0.6.12

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Release 0.6.12 - 2012/12/28
2
+
3
+ * Fix mongo 2.2 capped? problem in mongo_tail
4
+ * Add wait_time config to mongo_tail
5
+
6
+
1
7
  Release 0.6.11 - 2012/12/04
2
8
 
3
9
  * Use buildInfo instead of serverStatus to check version
data/README.rdoc CHANGED
@@ -133,6 +133,9 @@ Use _mongo_tail_ type in source.
133
133
 
134
134
  tag app.mongo_log
135
135
 
136
+ # waiting time when there is no next document. default is 1s.
137
+ wait_time 5
138
+
136
139
  # Convert 'time'(BSON's time) to fluent time(Unix time).
137
140
  time_key time
138
141
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.11
1
+ 0.6.12
@@ -11,6 +11,7 @@ class MongoTailInput < Input
11
11
  config_param :collection, :string
12
12
  config_param :host, :string, :default => 'localhost'
13
13
  config_param :port, :integer, :default => 27017
14
+ config_param :wait_time, :integer, :default => 1
14
15
 
15
16
  config_param :tag, :string, :default => nil
16
17
  config_param :tag_key, :string, :default => nil
@@ -69,7 +70,7 @@ class MongoTailInput < Input
69
70
  db = authenticate(Mongo::Connection.new(@host, @port).db(@database))
70
71
  raise ConfigError, "'#{@database}.#{@collection}' not found: node = #{@host}:#{@port}" unless db.collection_names.include?(@collection)
71
72
  collection = db.collection(@collection)
72
- raise ConfigError, "'#{@database}.#{@collection}' is not capped: node = #{@host}:#{@port}" unless collection.capped?
73
+ raise ConfigError, "'#{@database}.#{@collection}' is not capped: node = #{@host}:#{@port}" unless [1, true].include?(collection.stats['capped']) # older version(2.0.x or earlier) returns 1
73
74
  collection
74
75
  rescue Mongo::ConnectionFailure => e
75
76
  $log.fatal "Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: #{e}"
@@ -105,7 +106,7 @@ class MongoTailInput < Input
105
106
  # Should use MultiEventStream?
106
107
  Engine.emit(tag, time, doc)
107
108
  else
108
- sleep 1
109
+ sleep @wait_time
109
110
  end
110
111
  }
111
112
  rescue
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
12
+ date: 2012-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -134,18 +134,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
134
  - - ! '>='
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
- segments:
138
- - 0
139
- hash: -452154936217966637
140
137
  required_rubygems_version: !ruby/object:Gem::Requirement
141
138
  none: false
142
139
  requirements:
143
140
  - - ! '>='
144
141
  - !ruby/object:Gem::Version
145
142
  version: '0'
146
- segments:
147
- - 0
148
- hash: -452154936217966637
149
143
  requirements: []
150
144
  rubyforge_project:
151
145
  rubygems_version: 1.8.23