Class: Fluent::Rds_SlowlogInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Rds_SlowlogInput
- Defined in:
- lib/fluent/plugin/in_rds_slowlog.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ Rds_SlowlogInput
constructor
A new instance of Rds_SlowlogInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Rds_SlowlogInput
Returns a new instance of Rds_SlowlogInput.
15 16 17 18 |
# File 'lib/fluent/plugin/in_rds_slowlog.rb', line 15 def initialize super require 'mysql2' end |
Instance Method Details
#configure(conf) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fluent/plugin/in_rds_slowlog.rb', line 20 def configure(conf) super begin @client = Mysql2::Client.new({ :host => @host, :port => @port, :username => @username, :password => @password, :database => 'mysql' }) rescue log.error "fluent-plugin-rds-slowlog: cannot connect RDS" end end |
#shutdown ⇒ Object
40 41 42 43 44 |
# File 'lib/fluent/plugin/in_rds_slowlog.rb', line 40 def shutdown super @watcher.terminate @watcher.join end |
#start ⇒ Object
35 36 37 38 |
# File 'lib/fluent/plugin/in_rds_slowlog.rb', line 35 def start super @watcher = Thread.new(&method(:watch)) end |