fluent-plugin-yohoushi 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/fluent-plugin-yohoushi.gemspec +1 -1
- data/lib/fluent/plugin/out_yohoushi.rb +43 -32
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 009579c5fe1829e9e6f143382b731f14db70bdd8
|
4
|
+
data.tar.gz: 5317d1d4c97630e359db08f9647b42cc1a1bd92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b8f71c962165ad1bf6da37a5b86d8d41c2a4702aa2f8c44a48aec7cd6146e6f59ff7e944a0590f102b38b16494fe6910f82b092fb0bfff17fd63c6aeb98ee8f
|
7
|
+
data.tar.gz: 212404e79646cab6efcd99df52f5e975e202ccff44e6fadb05f3fcf7a974c8f551afb6fa04f93f9de2267b7ce108364323f9f958a950a18cf8fd8728ce1b545c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -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-yohoushi"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.4"
|
7
7
|
s.authors = ["Naotoshi Seo"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-yohoushi"
|
@@ -7,8 +7,8 @@ module Fluent
|
|
7
7
|
define_method("log") { $log }
|
8
8
|
end
|
9
9
|
|
10
|
-
MAPPING_MAX_NUM =
|
11
|
-
KEY_MAX_NUM =
|
10
|
+
MAPPING_MAX_NUM = 1024
|
11
|
+
KEY_MAX_NUM = 1024
|
12
12
|
|
13
13
|
def initialize
|
14
14
|
super
|
@@ -101,43 +101,47 @@ module Fluent
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def post(path, number)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
104
|
+
report_time(" path:#{path}", "trace") do
|
105
|
+
if @enable_float_number
|
106
|
+
@client.post_graph(path, { 'number' => number.to_f, 'mode' => @mode.to_s })
|
107
|
+
else
|
108
|
+
@client.post_graph(path, { 'number' => number.to_i, 'mode' => @mode.to_s })
|
109
|
+
end
|
108
110
|
end
|
109
111
|
rescue => e
|
110
112
|
log.warn "out_yohoushi: #{e.class} #{e.message} #{path} #{e.backtrace.first}"
|
111
113
|
end
|
112
114
|
|
113
115
|
def emit(tag, es, chain)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
116
|
+
report_time(" tag:#{tag}", "debug") do
|
117
|
+
tag_parts = tag.split('.')
|
118
|
+
tag_prefix = tag_prefix(tag_parts)
|
119
|
+
tag_suffix = tag_suffix(tag_parts)
|
120
|
+
placeholders = {
|
121
|
+
'tag' => tag,
|
122
|
+
'tags' => tag_parts, # for lower compatibility
|
123
|
+
'tag_parts' => tag_parts,
|
124
|
+
'tag_prefix' => tag_prefix,
|
125
|
+
'tag_suffix' => tag_suffix,
|
126
|
+
'hostname' => @hostname,
|
127
|
+
}
|
128
|
+
if @key_pattern
|
129
|
+
es.each do |time, record|
|
130
|
+
record.each do |key, value|
|
131
|
+
next unless key =~ @key_pattern
|
132
|
+
placeholders['key'] = key
|
133
|
+
path = expand_placeholder(@key_pattern_path, time, record, placeholders)
|
134
|
+
post(path, value)
|
135
|
+
end
|
132
136
|
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
137
|
+
else # keys
|
138
|
+
es.each do |time, record|
|
139
|
+
@keys.each do |key, path|
|
140
|
+
next unless value = record[key]
|
141
|
+
placeholders['key'] = key
|
142
|
+
path = expand_placeholder(path, time, record, placeholders)
|
143
|
+
post(path, value)
|
144
|
+
end
|
141
145
|
end
|
142
146
|
end
|
143
147
|
end
|
@@ -171,6 +175,13 @@ module Fluent
|
|
171
175
|
rev_tag_suffix.reverse
|
172
176
|
end
|
173
177
|
|
178
|
+
def report_time(msg = nil, level = "debug", &blk)
|
179
|
+
t = Time.now
|
180
|
+
output = yield
|
181
|
+
log.__send__(level, sprintf("out_yohoushi: elapsed_time:%.2f thread_id:%s%s caller:%s", (Time.now - t).to_f, Thread.current.object_id, msg, caller()[0]))
|
182
|
+
output
|
183
|
+
end
|
184
|
+
|
174
185
|
class PlaceholderExpander
|
175
186
|
attr_reader :placeholders
|
176
187
|
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-yohoushi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
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: 2015-08-03 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: growthforecast-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.62.4
|
34
34
|
type: :runtime
|
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.62.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: multiforecast-client
|
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: :runtime
|
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: yohoushi-client
|
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: :runtime
|
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: rake
|
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
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: pry-nav
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: Fluentd plugin to post data to yohoushi
|
@@ -129,10 +129,10 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
-
- .gitignore
|
133
|
-
- .pryrc
|
134
|
-
- .rspec
|
135
|
-
- .travis.yml
|
132
|
+
- ".gitignore"
|
133
|
+
- ".pryrc"
|
134
|
+
- ".rspec"
|
135
|
+
- ".travis.yml"
|
136
136
|
- CHANGELOG.md
|
137
137
|
- Gemfile
|
138
138
|
- LICENSE
|
@@ -152,17 +152,17 @@ require_paths:
|
|
152
152
|
- lib
|
153
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- -
|
160
|
+
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
164
|
rubyforge_project: fluent-plugin-yohoushi
|
165
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.4.5
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: Fluentd plugin to post data to yohoushi
|