lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-custom-0.1.1 vs lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-custom-0.1.2
- old
+ new
@@ -9,11 +9,11 @@
config_param :project, :string, :default => nil
config_param :key, :string, :default => nil
config_param :topic, :string
config_param :autocreate_topic, :bool, :default => false
config_param :max_messages, :integer, :default => 1000
- config_param :max_total_size, :integer, :default => 10000000 # 10MB
+ config_param :max_total_size, :integer, :default => 9800000 # 9.8MB
config_param :format, :string, :default => 'json'
unless method_defined?(:log)
define_method("log") { $log }
end
@@ -63,10 +63,10 @@
end
private
def publish(messages)
- log.debug "send message topic:#{@topic} length:#{messages.length.to_s}"
+ log.debug "send message topic:#{@topic} length:#{messages.length} size:#{messages.map(&:bytesize).inject(:+)}"
@publisher.publish messages
end
end
end