fluent-plugin-metricsense 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_metricsense.rb +34 -11
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTQwODg5MWU4OTUwMWMyZjg3ZGViYmQxNDZjZTU3YjM5OGZkYmFhNw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjEyM2NjYzQ5NjZjM2YzODBkMjg2MzcwODgwMjIyYzNjNzdkODI0Mw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjJjOWY0ZWE2ZjNkNGMxNzBkOGM5ZWQ5YzZjMzEzNjBkOGE3ZDg4MGFlMWFk
|
10
|
+
M2ZjNDNlYmZmYTM4YjdmOGQ0MDcwYWI0MTU5NGY5YjY1NGRkNDkxYTU2NTVm
|
11
|
+
NThmOGNmN2ZmMjEyM2RhYzgwMGZlMGNjNzlmZTQ1NTllMmE3ZjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTJlNmY0YmQ4ZWYzYTg4MTUyNjYwYmEwMGYwYmJjYzQ1NDVmZmIyZGI5ZjA1
|
14
|
+
YjNkNjk4ZTA4MzBiYzQ1YjIzMmJlZDZiZjVlYzAxNjEwMmIxMTY4YzA1YTBl
|
15
|
+
Mzc5MGY3ZjJmOWQwNDMwNzBmNDgyMjc2OGY3ODBiYmFmZDg1YWU=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
@@ -228,10 +228,20 @@ module Fluent
|
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
231
|
+
class SegmentedTotalUpdater < AddUpdater
|
232
|
+
def initialize(original_mode)
|
233
|
+
super()
|
234
|
+
@mode = original_mode
|
235
|
+
end
|
236
|
+
|
237
|
+
attr_reader :mode
|
238
|
+
end
|
239
|
+
|
231
240
|
AggregationKey = Struct.new(:tag, :time, :seg_val, :seg_key)
|
232
241
|
|
233
242
|
def write(chunk)
|
234
|
-
|
243
|
+
simple_counters = {}
|
244
|
+
segmented_counters = {}
|
235
245
|
|
236
246
|
# select sum(value) from chunk group by tag, time/60, seg_val, seg_key
|
237
247
|
chunk.msgpack_each {|tag,time,value,segments,update_mode|
|
@@ -248,21 +258,34 @@ module Fluent
|
|
248
258
|
updater = AddUpdater
|
249
259
|
end
|
250
260
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
261
|
+
if segments.empty?
|
262
|
+
# simple values
|
263
|
+
ak = AggregationKey.new(tag, time, nil, nil)
|
264
|
+
(simple_counters[ak] ||= updater.new).add(value)
|
265
|
+
else
|
266
|
+
# segmented values
|
267
|
+
segments.each_pair {|seg_key,seg_val|
|
268
|
+
ak = AggregationKey.new(tag, time, seg_val, seg_key)
|
269
|
+
(segmented_counters[ak] ||= updater.new).add(value)
|
270
|
+
}
|
271
|
+
end
|
272
|
+
}
|
257
273
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
274
|
+
# calculate total value of segmented values
|
275
|
+
segmented_totals = {}
|
276
|
+
segmented_counters.each_pair {|ak,up|
|
277
|
+
ak = AggregationKey.new(ak.tag, ak.time, nil, nil)
|
278
|
+
(segmented_totals[ak] ||= SegmentedTotalUpdater.new(up.mode)).add(up.value)
|
262
279
|
}
|
263
280
|
|
281
|
+
# simple_counters have higher priority than segmented_totals
|
282
|
+
counters = segmented_totals
|
283
|
+
counters.merge!(segmented_counters)
|
284
|
+
counters.merge!(simple_counters)
|
285
|
+
|
264
286
|
data = []
|
265
287
|
counters.each_pair {|ak,up|
|
288
|
+
p [ak.tag, ak.time, up.normalized_value(@normalize_factor), ak.seg_key, ak.seg_val, up.mode]
|
266
289
|
data << [ak.tag, ak.time, up.normalized_value(@normalize_factor), ak.seg_key, ak.seg_val, up.mode]
|
267
290
|
}
|
268
291
|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-metricsense
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-17 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.10.6
|
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.10.6
|
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.8.7
|
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.8.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.0.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: 1.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.5.4
|
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.5.4
|
69
69
|
description: MetricSense - application metrics aggregation plugin for Fluentd
|
@@ -72,7 +72,7 @@ executables: []
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
-
-
|
75
|
+
- .gitignore
|
76
76
|
- Gemfile
|
77
77
|
- README.rdoc
|
78
78
|
- Rakefile
|
@@ -91,12 +91,12 @@ require_paths:
|
|
91
91
|
- lib
|
92
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ! '>='
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
@@ -106,3 +106,4 @@ signing_key:
|
|
106
106
|
specification_version: 4
|
107
107
|
summary: MetricSense - application metrics aggregation plugin for Fluentd
|
108
108
|
test_files: []
|
109
|
+
has_rdoc: false
|