fluent-plugin-resque_stat 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fluent-plugin-resque_stat"
|
7
|
-
gem.version = "0.0.
|
7
|
+
gem.version = "0.0.5"
|
8
8
|
gem.authors = ["Spring_MT"]
|
9
9
|
gem.email = ["today.is.sky.blue.sky@gmail.com"]
|
10
10
|
gem.summary = %q{Fluent input plugin for Resque info}
|
@@ -7,16 +7,13 @@ module Fluent
|
|
7
7
|
require 'resque'
|
8
8
|
end
|
9
9
|
|
10
|
-
config_param :tag, :string
|
10
|
+
config_param :tag, :string
|
11
11
|
config_param :host, :string, :default => '127.0.0.1'
|
12
12
|
config_param :port, :integer, :default => 6379
|
13
13
|
config_param :run_interval, :time, :default => 60
|
14
14
|
|
15
15
|
def configure(conf)
|
16
16
|
super
|
17
|
-
if !@tag
|
18
|
-
raise ConfigError, "'tag' option is required on exec input"
|
19
|
-
end
|
20
17
|
Resque.redis = "#{@host}:#{@port}"
|
21
18
|
end
|
22
19
|
|
@@ -43,12 +40,9 @@ module Fluent
|
|
43
40
|
resque_stat = Resque.info
|
44
41
|
record = {}
|
45
42
|
resque_stat.each { |key, value| record[key.to_s] = value }
|
46
|
-
tag
|
47
|
-
if tag
|
48
|
-
Engine.emit(tag, Engine.now, record)
|
49
|
-
end
|
43
|
+
Engine.emit(@tag, Engine.now, record)
|
50
44
|
rescue => e
|
51
|
-
$log.error "
|
45
|
+
$log.error "rescue_stat failed to emit", :error => $!.to_s, :line => e.message
|
52
46
|
$log.warn_backtrace $!.backtrace
|
53
47
|
end
|
54
48
|
end
|