Class: Fluent::Plugin::RedisSlowlogInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_redis_slowlog.rb

Defined Under Namespace

Classes: Entry

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 23

def configure(conf)
  super

  @redis = Redis.new(
    url: url,
    host: host,
    port: port,
    path: path,
    password: password,
    timeout: timeout
  )
end

#shutdownObject



48
49
50
51
52
53
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 48

def shutdown
  super

  self.watching = false
  redis.quit
end

#startObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fluent/plugin/in_redis_slowlog.rb', line 36

def start
  super

  if redis.ping != "PONG"
    raise Redis::CannotConnectError,
          "Could not connect to redis"
  end

  self.watching = true
  self.watcher = thread_create(:redis_slowlog_watcher, &method(:watch))
end