Class: Fluent::Redis_SlowlogInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Redis_SlowlogInput
- Defined in:
- lib/fluent/plugin/in_redis_slowlog.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ Redis_SlowlogInput
constructor
A new instance of Redis_SlowlogInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Redis_SlowlogInput
Returns a new instance of Redis_SlowlogInput.
11 12 13 14 |
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 11 def initialize super require 'redis' end |
Instance Method Details
#configure(conf) ⇒ Object
16 17 18 19 20 |
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 16 def configure(conf) super @log_id = 0 @get_interval = @interval end |
#shutdown ⇒ Object
38 39 40 41 |
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 38 def shutdown super @redis.quit end |
#start ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 22 def start super @redis = Redis.new( :host => @host, :port => @port, :thread_safe => true ) pong = @redis.ping begin unless pong == 'PONG' raise "fluent-plugin-redis-slowlog: cannot connect redis" end end @watcher = Thread.new(&method(:watch)) end |