fluent-plugin-numeric-monitor 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0e34e02fb3c60ee05565ff9e7ed9c31bbf1f677
4
- data.tar.gz: b74595ed3a9194bb3da3f21d8d47749b97059bcd
3
+ metadata.gz: 068c4d7a79fb6422b2d5cbfdf85f4db7e9af771c
4
+ data.tar.gz: cbae106a78018a6b21a84c180a71787ac5a594a2
5
5
  SHA512:
6
- metadata.gz: 9031f88688412a012a965d9240639e51c65716bcc5248085c8bdff1e85bcde52b8b12d3703df11442464427a5b9c1459c26d8bfec907a60ec18fdfe62d72e21f
7
- data.tar.gz: 9ee81f7dfbe2483631df14dbea7553cced143f62c5631d23c25386cc1dcd6c669aa7b92fd59870b23a1c380090293031d44a9c6a9ee9c68ca2e71c22c8d8e31b
6
+ metadata.gz: ebc298cc98e95db9158300babf4b019eaadf4fc0e5d4ed49156136e4b6b4d5be98c24d37001e01b433d55b8cb79b0bd7172f0eaa2457a4b936590082920bd944
7
+ data.tar.gz: a570668005cde7155c1dde3d6eac554546afec5ca019c8f36c0e978018cb7a70efe3bf6fe5e60b55c2092140c4f093941677260823fede22f1911455349e1e61
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### NumericMonitorOutput
6
6
 
7
- Plugin to calculate min/max/avg and specified percentile values (and 'num' of matched messages), which used in notifications (such as fluent-plugin-notifier)
7
+ Plugin to calculate min/max/avg/sum and specified percentile values (and 'num' of matched messages), which used in notifications (such as fluent-plugin-notifier)
8
8
 
9
9
  ## Configuration
10
10
 
@@ -24,7 +24,7 @@ To calculate about HTTP requests duration (microseconds) in 'duraion', with 90 a
24
24
 
25
25
  Output messages like:
26
26
 
27
- {"min":3012,"max":913243,"avg":100123.51,"percentile_90":154390,"percentile_95":223110,"num":50012}
27
+ {"min":3012,"max":913243,"avg":100123.51,"sum":5007376982,"percentile_90":154390,"percentile_95":223110,"num":50012}
28
28
 
29
29
 
30
30
  ## Parameters
@@ -62,7 +62,7 @@ Output messages like:
62
62
 
63
63
  Calculate in each input `tag` separetely, or `all` records in a mass. Default is `tag`
64
64
 
65
- * ouput\_per\_tag
65
+ * output\_per\_tag
66
66
 
67
67
  Emit for each input tag. `tag_prefix` must be specified together. Default is `no`.
68
68
 
@@ -1,12 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-numeric-monitor"
4
- gem.version = "0.1.5"
4
+ gem.version = "0.1.6"
5
5
  gem.authors = ["TAGOMORI Satoshi"]
6
6
  gem.email = ["tagomoris@gmail.com"]
7
7
  gem.description = %q{Fluentd plugin to calculate min/max/avg/Xpercentile values, and emit these data as message}
8
8
  gem.summary = %q{Fluentd plugin to calculate min/max/avg/Xpercentile values}
9
9
  gem.homepage = "https://github.com/tagomoris/fluent-plugin-numeric-monitor"
10
+ gem.license = "APLv2"
10
11
 
11
12
  gem.files = `git ls-files`.split($\)
12
13
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -124,6 +124,7 @@ class Fluent::NumericMonitorOutput < Fluent::Output
124
124
  output[key_prefix + 'min'] = count[:min] if count[:min]
125
125
  output[key_prefix + 'max'] = count[:max] if count[:max]
126
126
  output[key_prefix + 'avg'] = (count[:sum] / (count[:num] * 1.0)) if count[:num] > 0
127
+ output[key_prefix + 'sum'] = count[:sum] if count[:sum]
127
128
  if @percentiles
128
129
  sorted = count[:sample].sort
129
130
  @percentiles.each do |p|
@@ -73,6 +73,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
73
73
  assert_equal 0, r1['tag1_min']
74
74
  assert_equal 9, r1['tag1_max']
75
75
  assert_equal 4.5, r1['tag1_avg']
76
+ assert_equal 450, r1['tag1_sum']
76
77
  assert_equal 7, r1['tag1_percentile_80']
77
78
  assert_equal 8, r1['tag1_percentile_90']
78
79
  assert_equal 100, r1['tag1_num']
@@ -106,6 +107,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
106
107
  assert_equal 0, r1['min']
107
108
  assert_equal 9, r1['max']
108
109
  assert_equal 4.5, r1['avg']
110
+ assert_equal 450, r1['sum']
109
111
  assert_equal 7, r1['percentile_80']
110
112
  assert_equal 8, r1['percentile_90']
111
113
  assert_equal 100, r1['num']
@@ -126,6 +128,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
126
128
  assert_equal 1, r['test_min']
127
129
  assert_equal 3, r['test_max']
128
130
  assert_equal 2, r['test_avg']
131
+ assert_equal 6, r['test_sum']
129
132
  assert_equal 3, r['test_num']
130
133
  end
131
134
 
@@ -152,12 +155,14 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
152
155
  assert_equal 1, r['min']
153
156
  assert_equal 3, r['max']
154
157
  assert_equal 2, r['avg']
158
+ assert_equal 6, r['sum']
155
159
  assert_equal 3, r['num']
156
160
  tag, r = d.emits[1][0], d.emits[1][2]
157
161
  assert_equal 'tag_prefix.tag2', tag
158
162
  assert_equal 1, r['min']
159
163
  assert_equal 3, r['max']
160
164
  assert_equal 2, r['avg']
165
+ assert_equal 6, r['sum']
161
166
  assert_equal 3, r['num']
162
167
 
163
168
  d = create_driver(CONFIG + %[
@@ -182,10 +187,12 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
182
187
  assert_equal 1, r['tag1_min']
183
188
  assert_equal 3, r['tag1_max']
184
189
  assert_equal 2, r['tag1_avg']
190
+ assert_equal 6, r['tag1_sum']
185
191
  assert_equal 3, r['tag1_num']
186
192
  assert_equal 1, r['tag2_min']
187
193
  assert_equal 3, r['tag2_max']
188
194
  assert_equal 2, r['tag2_avg']
195
+ assert_equal 6, r['tag1_sum']
189
196
  assert_equal 3, r['tag2_num']
190
197
 
191
198
  d = create_driver(CONFIG + %[
@@ -211,6 +218,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
211
218
  assert_equal 1, r['min']
212
219
  assert_equal 3, r['max']
213
220
  assert_equal 2, r['avg']
221
+ assert_equal 12, r['sum']
214
222
  assert_equal 6, r['num']
215
223
 
216
224
  d = create_driver(CONFIG + %[
@@ -236,6 +244,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
236
244
  assert_equal 1, r['min']
237
245
  assert_equal 3, r['max']
238
246
  assert_equal 2, r['avg']
247
+ assert_equal 12, r['sum']
239
248
  assert_equal 6, r['num']
240
249
  end
241
250
 
@@ -263,12 +272,14 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
263
272
  assert_equal 1, r['key_prefix_min']
264
273
  assert_equal 3, r['key_prefix_max']
265
274
  assert_equal 2, r['key_prefix_avg']
275
+ assert_equal 6, r['key_prefix_sum']
266
276
  assert_equal 3, r['key_prefix_num']
267
277
  tag, r = d.emits[1][0], d.emits[1][2]
268
278
  assert_equal 'tag_prefix.tag2', tag
269
279
  assert_equal 1, r['key_prefix_min']
270
280
  assert_equal 3, r['key_prefix_max']
271
281
  assert_equal 2, r['key_prefix_avg']
282
+ assert_equal 6, r['key_prefix_sum']
272
283
  assert_equal 3, r['key_prefix_num']
273
284
 
274
285
  d = create_driver(CONFIG + %[
@@ -294,10 +305,12 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
294
305
  assert_equal 1, r['key_prefix_tag1_min']
295
306
  assert_equal 3, r['key_prefix_tag1_max']
296
307
  assert_equal 2, r['key_prefix_tag1_avg']
308
+ assert_equal 6, r['key_prefix_tag1_sum']
297
309
  assert_equal 3, r['key_prefix_tag1_num']
298
310
  assert_equal 1, r['key_prefix_tag2_min']
299
311
  assert_equal 3, r['key_prefix_tag2_max']
300
312
  assert_equal 2, r['key_prefix_tag2_avg']
313
+ assert_equal 6, r['key_prefix_tag2_sum']
301
314
  assert_equal 3, r['key_prefix_tag2_num']
302
315
 
303
316
  d = create_driver(CONFIG + %[
@@ -324,6 +337,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
324
337
  assert_equal 1, r['key_prefix_min']
325
338
  assert_equal 3, r['key_prefix_max']
326
339
  assert_equal 2, r['key_prefix_avg']
340
+ assert_equal 12, r['key_prefix_sum']
327
341
  assert_equal 6, r['key_prefix_num']
328
342
 
329
343
  d = create_driver(CONFIG + %[
@@ -350,6 +364,7 @@ class NumericMonitorOutputTest < Test::Unit::TestCase
350
364
  assert_equal 1, r['key_prefix_min']
351
365
  assert_equal 3, r['key_prefix_max']
352
366
  assert_equal 2, r['key_prefix_avg']
367
+ assert_equal 12, r['key_prefix_sum']
353
368
  assert_equal 6, r['key_prefix_num']
354
369
  end
355
370
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-numeric-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-07 00:00:00.000000000 Z
11
+ date: 2013-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -47,6 +47,7 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - .gitignore
50
+ - .travis.yml
50
51
  - Gemfile
51
52
  - LICENSE.txt
52
53
  - README.md
@@ -56,7 +57,8 @@ files:
56
57
  - test/helper.rb
57
58
  - test/plugin/test_out_numeric_monitor.rb
58
59
  homepage: https://github.com/tagomoris/fluent-plugin-numeric-monitor
59
- licenses: []
60
+ licenses:
61
+ - APLv2
60
62
  metadata: {}
61
63
  post_install_message:
62
64
  rdoc_options: []
@@ -74,10 +76,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
76
  version: '0'
75
77
  requirements: []
76
78
  rubyforge_project:
77
- rubygems_version: 2.0.2
79
+ rubygems_version: 2.0.3
78
80
  signing_key:
79
81
  specification_version: 4
80
82
  summary: Fluentd plugin to calculate min/max/avg/Xpercentile values
81
83
  test_files:
82
84
  - test/helper.rb
83
85
  - test/plugin/test_out_numeric_monitor.rb
86
+ has_rdoc: