fluent-plugin-stats-notifier 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -2
- data/CHANGELOG.md +7 -0
- data/Gemfile.v0.10 +4 -0
- data/Gemfile.v0.12 +4 -0
- data/example.conf +18 -0
- data/fluent-plugin-stats-notifier.gemspec +2 -1
- data/lib/fluent/plugin/out_stats_notifier.rb +7 -2
- metadata +37 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 985370532ba3fc6ebcaa9495bdfbbde375becf8d
|
4
|
+
data.tar.gz: 3a18b0db66da211900c69983c8985a8d57a5daf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bf792d98204eda7f15eeb163fd46336287241bc65c2b67e781abf6e4863849810fbf94e85ba05e9fa54918bb099ae83cf591a6340ca7723b7ff1da1d80835f1
|
7
|
+
data.tar.gz: b1136f5a9c8aa7c49b99be10fab25dfe93d447fb7978b537eba071528fb023cbc3b040223148f41f723b7bcd7b106c82f55084ebd7ae5d9b9eb84ff6e84d23f9
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.v0.10
ADDED
data/Gemfile.v0.12
ADDED
data/example.conf
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
<source>
|
2
|
+
type dummy
|
3
|
+
tag dummy
|
4
|
+
dummy {"4xx_count":1,"foobar":"2"}
|
5
|
+
</source>
|
6
|
+
|
7
|
+
<match dummy>
|
8
|
+
type stats_notifier
|
9
|
+
tag notifier
|
10
|
+
interval 3
|
11
|
+
target_key 4xx_count
|
12
|
+
greater_equal 2
|
13
|
+
stats sum
|
14
|
+
</match>
|
15
|
+
|
16
|
+
<match notifier>
|
17
|
+
type stdout
|
18
|
+
</match>
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-stats-notifier"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.5"
|
7
7
|
s.authors = ["Naotoshi Seo"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-stats-notifier"
|
@@ -23,4 +23,5 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency "rspec"
|
24
24
|
s.add_development_dependency "pry"
|
25
25
|
s.add_development_dependency "pry-nav"
|
26
|
+
s.add_development_dependency "test-unit"
|
26
27
|
end
|
@@ -7,6 +7,11 @@ class Fluent::StatsNotifierOutput < Fluent::Output
|
|
7
7
|
define_method("log") { $log }
|
8
8
|
end
|
9
9
|
|
10
|
+
# Define `router` method of v0.12 to support v0.10 or earlier
|
11
|
+
unless method_defined?(:router)
|
12
|
+
define_method("router") { Fluent::Engine }
|
13
|
+
end
|
14
|
+
|
10
15
|
def initialize
|
11
16
|
super
|
12
17
|
require 'pathname'
|
@@ -174,13 +179,13 @@ class Fluent::StatsNotifierOutput < Fluent::Output
|
|
174
179
|
values = evented_queues.values.map {|queue| queue[@target_key] }.compact
|
175
180
|
value = get_stats(values, @aggregate_stats)
|
176
181
|
output = generate_output(value) if value
|
177
|
-
|
182
|
+
router.emit(@tag, time, output) if output
|
178
183
|
else # aggregate tag
|
179
184
|
evented_queues.each do |tag, queue|
|
180
185
|
value = queue[@target_key]
|
181
186
|
output = generate_output(value) if value
|
182
187
|
emit_tag = @tag_proc.call(tag)
|
183
|
-
|
188
|
+
router.emit(emit_tag, time, output) if output
|
184
189
|
end
|
185
190
|
end
|
186
191
|
end
|
metadata
CHANGED
@@ -1,83 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-stats-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry-nav
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: test-unit
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
description: Fluentd plugin to calculate statistics and then thresholding
|
@@ -87,15 +101,18 @@ executables: []
|
|
87
101
|
extensions: []
|
88
102
|
extra_rdoc_files: []
|
89
103
|
files:
|
90
|
-
- .coveralls.yml
|
91
|
-
- .gitignore
|
92
|
-
- .rdebugrc
|
93
|
-
- .rspec
|
94
|
-
- .travis.yml
|
104
|
+
- ".coveralls.yml"
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rdebugrc"
|
107
|
+
- ".rspec"
|
108
|
+
- ".travis.yml"
|
95
109
|
- CHANGELOG.md
|
96
110
|
- Gemfile
|
111
|
+
- Gemfile.v0.10
|
112
|
+
- Gemfile.v0.12
|
97
113
|
- README.md
|
98
114
|
- Rakefile
|
115
|
+
- example.conf
|
99
116
|
- fluent-plugin-stats-notifier.gemspec
|
100
117
|
- lib/fluent/plugin/out_stats_notifier.rb
|
101
118
|
- spec/out_stats_notifier_spec.rb
|
@@ -110,17 +127,17 @@ require_paths:
|
|
110
127
|
- lib
|
111
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
129
|
requirements:
|
113
|
-
- -
|
130
|
+
- - ">="
|
114
131
|
- !ruby/object:Gem::Version
|
115
132
|
version: '0'
|
116
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
134
|
requirements:
|
118
|
-
- -
|
135
|
+
- - ">="
|
119
136
|
- !ruby/object:Gem::Version
|
120
137
|
version: '0'
|
121
138
|
requirements: []
|
122
139
|
rubyforge_project: fluent-plugin-stats-notifier
|
123
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.5.2
|
124
141
|
signing_key:
|
125
142
|
specification_version: 4
|
126
143
|
summary: Fluentd plugin to calculate statistics and then thresholding
|