fluent-plugin-mackerel 0.1.3 → 1.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/README.md +11 -9
- data/fluent-plugin-mackerel.gemspec +3 -3
- data/lib/fluent/plugin/out_mackerel.rb +17 -5
- data/test/helper.rb +4 -2
- data/test/plugin/test_out_mackerel.rb +39 -31
- data/test/plugin/test_out_mackerel_hostid_tag.rb +8 -8
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb25b1bebca00458ef188707294fe348300e118d
|
4
|
+
data.tar.gz: 13f96b2fb493d0dfa870f602abef8f3bbd8b50bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd13a7e12775ab9808e23bb7dfdc2952c60be1be738f9369dd8a03177bf3609c36a45628ac624a1f08b99ce35c7ac6d8247d829e093b7de7468cc0633dc3128a
|
7
|
+
data.tar.gz: 556685cba190b6afbf59566941bbd796959bd3803fbe5d0fd9befc12a8e50cf72ed93c3f802a4732a8611b6b09c1d9d34e412ada9b2f717e14582d159784a3fe
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -22,10 +22,10 @@ $ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-mackerel
|
|
22
22
|
|
23
23
|
### MackerelOutput
|
24
24
|
|
25
|
-
This plugin uses mackerel.io's [APIv0](
|
25
|
+
This plugin uses mackerel.io's [APIv0](https://mackerel.io/api-docs/).
|
26
26
|
```
|
27
27
|
<match ...>
|
28
|
-
type mackerel
|
28
|
+
@type mackerel
|
29
29
|
api_key 123456
|
30
30
|
hostid xyz
|
31
31
|
metrics_name http_status.${out_key}
|
@@ -52,7 +52,7 @@ For example, if you have set `out_keys 2xx_count,3xx_count,4xx_count,5xx_count`,
|
|
52
52
|
|
53
53
|
```
|
54
54
|
<match ...>
|
55
|
-
type mackerel
|
55
|
+
@type mackerel
|
56
56
|
api_key 123456
|
57
57
|
service yourservice
|
58
58
|
metrics_name http_status.${out_key}
|
@@ -63,7 +63,7 @@ For example, if you have set `out_keys 2xx_count,3xx_count,4xx_count,5xx_count`,
|
|
63
63
|
|
64
64
|
```
|
65
65
|
<match mackerel.*>
|
66
|
-
type mackerel
|
66
|
+
@type mackerel
|
67
67
|
api_key 123456
|
68
68
|
hostid xyz
|
69
69
|
metrics_name ${[1]}.${out_key}
|
@@ -85,7 +85,7 @@ This indicates the value of the `n` th index of the array. By splitting the tag
|
|
85
85
|
You can also send [service metrics](http://help.mackerel.io/entry/spec/api/v0#service-metric-value-post) as shown.
|
86
86
|
```
|
87
87
|
<match ...>
|
88
|
-
type mackerel
|
88
|
+
@type mackerel
|
89
89
|
api_key 123456
|
90
90
|
service yourservice
|
91
91
|
metrics_name http_status.${out_key}
|
@@ -98,7 +98,7 @@ This option is not availabe when sending host metrics.
|
|
98
98
|
|
99
99
|
```
|
100
100
|
<match ...>
|
101
|
-
type mackerel
|
101
|
+
@type mackerel
|
102
102
|
api_key 123456
|
103
103
|
service yourservice
|
104
104
|
remove_prefix
|
@@ -123,7 +123,7 @@ From version 0.0.4 and on, metrics_prefix has been removed and metrics_name shou
|
|
123
123
|
Let's say you want to add the hostid to the record with a specific key name...
|
124
124
|
```
|
125
125
|
<match ...>
|
126
|
-
type mackerel_hostid_tag
|
126
|
+
@type mackerel_hostid_tag
|
127
127
|
add_to record
|
128
128
|
key_name mackerel_hostid
|
129
129
|
</match>
|
@@ -133,12 +133,14 @@ As shown above, the key_name field is required. For example if the host_id is "x
|
|
133
133
|
To append the hostid to the tag, you can simply configure "add_to" as "tag" like this.
|
134
134
|
```
|
135
135
|
<match ...>
|
136
|
-
type mackerel_hostid_tag
|
136
|
+
@type mackerel_hostid_tag
|
137
137
|
add_to tag
|
138
138
|
</match>
|
139
139
|
```
|
140
140
|
If the input is `["test", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`, then the output will be `["test.xyz", 1407650400, {"val1"=>1, "val2"=>2, "val3"=>3, "val4"=>4}]`
|
141
141
|
|
142
|
+
Both `add_prefix` and `remove_prefix` options are availale to control rebuilding tags.
|
143
|
+
|
142
144
|
## TODO
|
143
145
|
|
144
146
|
Pull requests are very welcome!!
|
@@ -173,7 +175,7 @@ $ bundle exec rake release
|
|
173
175
|
For debugging purposes, you can change the Mackerel endpoint with an `origin` parameter like this.
|
174
176
|
```
|
175
177
|
<match ...>
|
176
|
-
type mackerel
|
178
|
+
@type mackerel
|
177
179
|
api_key 123456
|
178
180
|
hostid xyz
|
179
181
|
metrics_name http_status.${out_key}
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-mackerel"
|
7
|
-
spec.version = "0.
|
7
|
+
spec.version = "1.0.0"
|
8
8
|
spec.authors = ["tksmd","hatz48","stanaka","Songmu"]
|
9
9
|
spec.email = ["developers@mackerel.io"]
|
10
10
|
spec.description = %q{fluent plugin to send metrics to mackerel.io}
|
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
23
23
|
spec.add_development_dependency "rake"
|
24
|
-
spec.add_development_dependency "rr", ">= 1.0.0"
|
25
24
|
spec.add_development_dependency "test-unit"
|
26
|
-
spec.
|
25
|
+
spec.add_development_dependency "test-unit-rr"
|
26
|
+
spec.add_runtime_dependency "fluentd", [">= 0.14.8", "< 2"]
|
27
27
|
|
28
28
|
spec.required_ruby_version = '>= 1.9.3'
|
29
29
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'mackerel/client'
|
2
2
|
|
3
|
-
module Fluent
|
4
|
-
class MackerelOutput <
|
3
|
+
module Fluent::Plugin
|
4
|
+
class MackerelOutput < Output
|
5
5
|
Fluent::Plugin.register_output('mackerel', self)
|
6
6
|
|
7
|
+
helpers :compat_parameters
|
8
|
+
|
9
|
+
DEFAULT_FLUSH_INTERVAL = 60
|
10
|
+
|
7
11
|
config_param :api_key, :string, :secret => true
|
8
12
|
config_param :hostid, :string, :default => nil
|
9
13
|
config_param :hostid_path, :string, :default => nil
|
@@ -18,6 +22,10 @@ module Fluent
|
|
18
22
|
MAX_BUFFER_CHUNK_LIMIT = 100 * 1024
|
19
23
|
config_set_default :buffer_chunk_limit, MAX_BUFFER_CHUNK_LIMIT
|
20
24
|
config_set_default :buffer_queue_limit, 4096
|
25
|
+
config_section :buffer do
|
26
|
+
config_set_default :@type, 'memory'
|
27
|
+
config_set_default :flush_interval, DEFAULT_FLUSH_INTERVAL
|
28
|
+
end
|
21
29
|
|
22
30
|
attr_reader :mackerel
|
23
31
|
|
@@ -31,6 +39,7 @@ module Fluent
|
|
31
39
|
end
|
32
40
|
|
33
41
|
def configure(conf)
|
42
|
+
compat_parameters_convert(conf, :buffer)
|
34
43
|
super
|
35
44
|
|
36
45
|
@mackerel = Mackerel::Client.new(:mackerel_api_key => conf['api_key'], :mackerel_origin => conf['origin'])
|
@@ -45,9 +54,8 @@ module Fluent
|
|
45
54
|
raise Fluent::ConfigError, "Either 'out_keys' or 'out_key_pattern' must be specifed."
|
46
55
|
end
|
47
56
|
|
48
|
-
if @flush_interval < 60
|
49
|
-
|
50
|
-
@flush_interval = 60
|
57
|
+
if @buffer_config.flush_interval and @buffer_config.flush_interval < 60
|
58
|
+
raise Fluent::ConfigError, "flush_interval less than 60s is not allowed."
|
51
59
|
end
|
52
60
|
|
53
61
|
unless @hostid_path.nil?
|
@@ -98,6 +106,10 @@ module Fluent
|
|
98
106
|
super
|
99
107
|
end
|
100
108
|
|
109
|
+
def formatted_to_msgpack_binary
|
110
|
+
true
|
111
|
+
end
|
112
|
+
|
101
113
|
def format(tag, time, record)
|
102
114
|
[tag, time, record].to_msgpack
|
103
115
|
end
|
data/test/helper.rb
CHANGED
@@ -8,7 +8,7 @@ rescue Bundler::BundlerError => e
|
|
8
8
|
exit e.status_code
|
9
9
|
end
|
10
10
|
require 'test/unit'
|
11
|
-
require 'rr'
|
11
|
+
require 'test/unit/rr'
|
12
12
|
|
13
13
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
14
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
@@ -23,8 +23,10 @@ unless ENV.has_key?('VERBOSE')
|
|
23
23
|
$log = nulllogger
|
24
24
|
end
|
25
25
|
|
26
|
+
require 'test/unit/rr'
|
27
|
+
require 'fluent/test/driver/output'
|
26
28
|
require 'fluent/plugin/out_mackerel'
|
27
29
|
require 'fluent/plugin/out_mackerel_hostid_tag'
|
28
30
|
|
29
31
|
class Test::Unit::TestCase
|
30
|
-
end
|
32
|
+
end
|
@@ -88,7 +88,7 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
88
88
|
type mackerel
|
89
89
|
api_key 123456
|
90
90
|
service xyz
|
91
|
-
out_keys val1,val2
|
91
|
+
out_keys val1,val2
|
92
92
|
]
|
93
93
|
|
94
94
|
CONFIG_SERVICE_REMOVE_PREFIX = %[
|
@@ -96,7 +96,7 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
96
96
|
api_key 123456
|
97
97
|
service xyz
|
98
98
|
remove_prefix
|
99
|
-
out_keys val1,val2
|
99
|
+
out_keys val1,val2
|
100
100
|
]
|
101
101
|
|
102
102
|
CONFIG_INVALID_REMOVE_PREFIX = %[
|
@@ -114,8 +114,8 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
114
114
|
out_keys val1,val2,val3
|
115
115
|
]
|
116
116
|
|
117
|
-
def create_driver(conf = CONFIG
|
118
|
-
Fluent::Test::
|
117
|
+
def create_driver(conf = CONFIG)
|
118
|
+
Fluent::Test::Driver::Output.new(Fluent::Plugin::MackerelOutput).configure(conf)
|
119
119
|
end
|
120
120
|
|
121
121
|
def test_configure
|
@@ -140,8 +140,9 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
140
140
|
d = create_driver(CONFIG_INVALID_REMOVE_PREFIX)
|
141
141
|
}
|
142
142
|
|
143
|
-
|
144
|
-
|
143
|
+
assert_raise(Fluent::ConfigError) {
|
144
|
+
d = create_driver(CONFIG_SMALL_FLUSH_INTERVAL)
|
145
|
+
}
|
145
146
|
|
146
147
|
d = create_driver(CONFIG_ORIGIN)
|
147
148
|
assert_equal d.instance.instance_variable_get(:@origin), 'example.domain'
|
@@ -151,18 +152,19 @@ class MackerelOutputTest < Test::Unit::TestCase
|
|
151
152
|
assert_equal d.instance.instance_variable_get(:@hostid), 'xyz'
|
152
153
|
assert_equal d.instance.instance_variable_get(:@metrics_name), 'service.${out_key}'
|
153
154
|
assert_equal d.instance.instance_variable_get(:@out_keys), ['val1','val2','val3']
|
154
|
-
|
155
|
+
buffer = d.instance.instance_variable_get(:@buffer_config)
|
156
|
+
assert_equal buffer.flush_interval, 60
|
155
157
|
|
156
158
|
d = create_driver(CONFIG_OUT_KEY_PATTERN)
|
157
159
|
assert_match d.instance.instance_variable_get(:@out_key_pattern), "val1"
|
158
160
|
assert_no_match d.instance.instance_variable_get(:@out_key_pattern), "foo"
|
159
161
|
|
160
162
|
d = create_driver(CONFIG_BUFFER_LIMIT_DEFAULT)
|
161
|
-
assert_equal d.instance.instance_variable_get(:@buffer_chunk_limit), Fluent::MackerelOutput::MAX_BUFFER_CHUNK_LIMIT
|
163
|
+
assert_equal d.instance.instance_variable_get(:@buffer_chunk_limit), Fluent::Plugin::MackerelOutput::MAX_BUFFER_CHUNK_LIMIT
|
162
164
|
assert_equal d.instance.instance_variable_get(:@buffer_queue_limit), 4096
|
163
165
|
|
164
166
|
d = create_driver(CONFIG_BUFFER_LIMIT_IGNORE)
|
165
|
-
assert_equal d.instance.instance_variable_get(:@buffer_chunk_limit), Fluent::MackerelOutput::MAX_BUFFER_CHUNK_LIMIT
|
167
|
+
assert_equal d.instance.instance_variable_get(:@buffer_chunk_limit), Fluent::Plugin::MackerelOutput::MAX_BUFFER_CHUNK_LIMIT
|
166
168
|
|
167
169
|
end
|
168
170
|
|
@@ -180,11 +182,12 @@ end
|
|
180
182
|
])
|
181
183
|
|
182
184
|
ENV["TZ"]="Asia/Tokyo"
|
183
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
184
|
-
d.
|
185
|
-
|
186
|
-
|
187
|
-
|
185
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
186
|
+
d.run(default_tag: 'test') do
|
187
|
+
d.feed(t, {'val1' => 1, 'val2' => 2, 'val3' => 3, 'val4' => 4})
|
188
|
+
d.feed(t, {'val1' => 5, 'val2' => 6, 'val3' => 7, 'val4' => 8})
|
189
|
+
d.feed(t, {'val1' => 9, 'val2' => 10})
|
190
|
+
end
|
188
191
|
end
|
189
192
|
|
190
193
|
def test_write_pattern
|
@@ -195,22 +198,24 @@ end
|
|
195
198
|
])
|
196
199
|
|
197
200
|
ENV["TZ"]="Asia/Tokyo"
|
198
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
199
|
-
d.
|
200
|
-
|
201
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
202
|
+
d.run(default_tag: 'test') do
|
203
|
+
d.feed(t, {'val1' => 1, 'val2' => 2, 'foo' => 3})
|
204
|
+
end
|
201
205
|
end
|
202
206
|
|
203
207
|
def test_write_issue4
|
204
|
-
d = create_driver(CONFIG_FOR_ISSUE_4
|
208
|
+
d = create_driver(CONFIG_FOR_ISSUE_4)
|
205
209
|
mock(d.instance.mackerel).post_metrics([
|
206
210
|
{"hostId"=>"xyz", "value"=>1.0, "time"=>1399997498, "name"=>"custom.a-status-b.val1"},
|
207
211
|
{"hostId"=>"xyz", "value"=>2.0, "time"=>1399997498, "name"=>"custom.a-status-b.val2"},
|
208
212
|
])
|
209
213
|
|
210
214
|
ENV["TZ"]="Asia/Tokyo"
|
211
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
212
|
-
d.
|
213
|
-
|
215
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
216
|
+
d.run(default_tag: 'test.status') do
|
217
|
+
d.feed(t, {'val1' => 1, 'val2' => 2})
|
218
|
+
end
|
214
219
|
end
|
215
220
|
|
216
221
|
def test_service
|
@@ -221,9 +226,10 @@ end
|
|
221
226
|
])
|
222
227
|
|
223
228
|
ENV["TZ"]="Asia/Tokyo"
|
224
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
225
|
-
d.
|
226
|
-
|
229
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
230
|
+
d.run(default_tag: 'test') do
|
231
|
+
d.feed(t, {'val1' => 1, 'val2' => 2, 'foo' => 3})
|
232
|
+
end
|
227
233
|
end
|
228
234
|
|
229
235
|
def test_service_remove_prefix
|
@@ -234,9 +240,10 @@ end
|
|
234
240
|
])
|
235
241
|
|
236
242
|
ENV["TZ"]="Asia/Tokyo"
|
237
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
238
|
-
d.
|
239
|
-
|
243
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
244
|
+
d.run(default_tag: 'test') do
|
245
|
+
d.feed(t, {'val1' => 1, 'val2' => 2, 'foo' => 3})
|
246
|
+
end
|
240
247
|
end
|
241
248
|
|
242
249
|
def test_service_use_zero
|
@@ -248,9 +255,10 @@ end
|
|
248
255
|
])
|
249
256
|
|
250
257
|
ENV["TZ"]="Asia/Tokyo"
|
251
|
-
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T')
|
252
|
-
d.
|
253
|
-
|
258
|
+
t = Time.strptime('2014-05-14 01:11:38', '%Y-%m-%d %T').to_i
|
259
|
+
d.run(default_tag: 'test') do
|
260
|
+
d.feed(t, {'val1' => 1, 'val2' => 2, 'foo' => 3})
|
261
|
+
end
|
254
262
|
end
|
255
263
|
|
256
264
|
def test_name_processor
|
@@ -281,7 +289,7 @@ end
|
|
281
289
|
metrics_name #{obj[:metrics_name]}
|
282
290
|
out_keys val1,val2
|
283
291
|
]
|
284
|
-
d = create_driver(test_config
|
292
|
+
d = create_driver(test_config)
|
285
293
|
name_processor = d.instance.instance_variable_get(:@name_processor)
|
286
294
|
actual = name_processor.map{ |p| p.call(:out_key => 'val1', :tokens => ['test', 'status']) }.join('.')
|
287
295
|
assert_equal obj[:expected], actual
|
@@ -101,7 +101,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
101
101
|
emits = d.emits
|
102
102
|
assert_equal 2, emits.length
|
103
103
|
assert_equal 'test.xyz', emits[0][0] # tag
|
104
|
-
assert_equal 1407650400, emits[0][1] # time
|
104
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
105
105
|
assert_equal 4, emits[0][2].length # record
|
106
106
|
assert_equal 1, emits[0][2]["val1"] # record
|
107
107
|
assert_equal 2, emits[0][2]["val2"] # record
|
@@ -109,7 +109,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
109
109
|
assert_equal 4, emits[0][2]["val4"] # record
|
110
110
|
|
111
111
|
assert_equal 'test.xyz', emits[1][0] # tag
|
112
|
-
assert_equal 1407650400, emits[1][1] # time
|
112
|
+
assert_equal 1407650400, emits[1][1].to_i # time
|
113
113
|
assert_equal 4, emits[1][2].length # record
|
114
114
|
assert_equal 5, emits[1][2]["val1"] # record
|
115
115
|
assert_equal 6, emits[1][2]["val2"] # record
|
@@ -131,7 +131,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
131
131
|
emits = d.emits
|
132
132
|
assert_equal 2, emits.length
|
133
133
|
assert_equal 'test', emits[0][0] # tag
|
134
|
-
assert_equal 1407650400, emits[0][1] # time
|
134
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
135
135
|
assert_equal 5, emits[0][2].length # record length
|
136
136
|
assert_equal 1, emits[0][2]["val1"] # record
|
137
137
|
assert_equal 2, emits[0][2]["val2"] # record
|
@@ -140,7 +140,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
140
140
|
assert_equal "xyz", emits[0][2]["mackerel_hostid"] # record
|
141
141
|
|
142
142
|
assert_equal 'test', emits[1][0] # tag
|
143
|
-
assert_equal 1407650400, emits[1][1] # time
|
143
|
+
assert_equal 1407650400, emits[1][1].to_i # time
|
144
144
|
assert_equal 5, emits[1][2].length # record length
|
145
145
|
assert_equal 5, emits[1][2]["val1"] # record
|
146
146
|
assert_equal 6, emits[1][2]["val2"] # record
|
@@ -162,7 +162,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
162
162
|
emits = d.emits
|
163
163
|
assert_equal 1, emits.length
|
164
164
|
assert_equal 'service', emits[0][0] # tag
|
165
|
-
assert_equal 1407650400, emits[0][1] # time
|
165
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
166
166
|
assert_equal 5, emits[0][2].length # record length
|
167
167
|
assert_equal 1, emits[0][2]["val1"] # record
|
168
168
|
assert_equal 2, emits[0][2]["val2"] # record
|
@@ -185,7 +185,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
185
185
|
emits = d.emits
|
186
186
|
assert_equal 1, emits.length
|
187
187
|
assert_equal 'mackerel.test', emits[0][0] # tag
|
188
|
-
assert_equal 1407650400, emits[0][1] # time
|
188
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
189
189
|
assert_equal 5, emits[0][2].length # record length
|
190
190
|
assert_equal 1, emits[0][2]["val1"] # record
|
191
191
|
assert_equal 2, emits[0][2]["val2"] # record
|
@@ -208,7 +208,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
208
208
|
emits = d.emits
|
209
209
|
assert_equal 1, emits.length
|
210
210
|
assert_equal 'mackerel.service', emits[0][0] # tag
|
211
|
-
assert_equal 1407650400, emits[0][1] # time
|
211
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
212
212
|
assert_equal 5, emits[0][2].length # record length
|
213
213
|
assert_equal 1, emits[0][2]["val1"] # record
|
214
214
|
assert_equal 2, emits[0][2]["val2"] # record
|
@@ -231,7 +231,7 @@ class MackerelHostidTagOutputTest < Test::Unit::TestCase
|
|
231
231
|
emits = d.emits
|
232
232
|
assert_equal 1, emits.length
|
233
233
|
assert_equal 'mackerel.service.xyz', emits[0][0] # tag
|
234
|
-
assert_equal 1407650400, emits[0][1] # time
|
234
|
+
assert_equal 1407650400, emits[0][1].to_i # time
|
235
235
|
assert_equal 4, emits[0][2].length # record length
|
236
236
|
assert_equal 1, emits[0][2]["val1"] # record
|
237
237
|
assert_equal 2, emits[0][2]["val2"] # record
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mackerel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tksmd
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: mackerel-client
|
@@ -56,21 +56,21 @@ dependencies:
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
59
|
+
name: test-unit
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: '0'
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
71
|
+
version: '0'
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
|
-
name: test-unit
|
73
|
+
name: test-unit-rr
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
76
|
- - ">="
|
@@ -89,14 +89,20 @@ dependencies:
|
|
89
89
|
requirements:
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
92
|
+
version: 0.14.8
|
93
|
+
- - "<"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2'
|
93
96
|
type: :runtime
|
94
97
|
prerelease: false
|
95
98
|
version_requirements: !ruby/object:Gem::Requirement
|
96
99
|
requirements:
|
97
100
|
- - ">="
|
98
101
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
102
|
+
version: 0.14.8
|
103
|
+
- - "<"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '2'
|
100
106
|
description: fluent plugin to send metrics to mackerel.io
|
101
107
|
email:
|
102
108
|
- developers@mackerel.io
|