fluent-plugin-flowcounter 0.3.0 → 0.3.1
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/fluent-plugin-flowcounter.gemspec +1 -1
- data/lib/fluent/plugin/out_flowcounter.rb +6 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4106b69e6d5a5c4e44996ab86bf6bf3220bc11b
|
4
|
+
data.tar.gz: fbe0fa0f5c544e265b37e3023a24e0bd66d0ae1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4b7e9a9543eb01212b56b413569fb210bcaa6ea5bc53c2f8aa02371a5c80bc0612e618280c063df6c8be39365f24217e6bded2c793004ce70ea982f84225d0b
|
7
|
+
data.tar.gz: 39aa071b23d739acdccea9768036e03953d569fa4493a7a216b89228d65484843df0d5d73ee409458d0b1ad53389995f97d41917b8dcfa61daf705f13cf8f01c
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = "fluent-plugin-flowcounter"
|
4
|
-
gem.version = "0.3.
|
4
|
+
gem.version = "0.3.1"
|
5
5
|
gem.authors = ["TAGOMORI Satoshi"]
|
6
6
|
gem.email = ["tagomoris@gmail.com"]
|
7
7
|
gem.summary = %q{Fluent plugin to count message flow}
|
@@ -19,6 +19,7 @@ class Fluent::FlowCounterOutput < Fluent::Output
|
|
19
19
|
config_param :tag, :string, :default => 'flowcount'
|
20
20
|
config_param :input_tag_remove_prefix, :string, :default => nil
|
21
21
|
config_param :count_keys, :string
|
22
|
+
config_param :delimiter, :string, :default => '_'
|
22
23
|
|
23
24
|
include Fluent::Mixin::ConfigPlaceholders
|
24
25
|
|
@@ -98,8 +99,8 @@ class Fluent::FlowCounterOutput < Fluent::Output
|
|
98
99
|
c = 'count'
|
99
100
|
b = 'bytes'
|
100
101
|
if @aggregate == :tag
|
101
|
-
c = name + '
|
102
|
-
b = name + '
|
102
|
+
c = name + delimiter + 'count'
|
103
|
+
b = name + delimiter + 'bytes'
|
103
104
|
end
|
104
105
|
@mutex.synchronize {
|
105
106
|
@counts[c] = (@counts[c] || 0) + counts
|
@@ -122,11 +123,11 @@ class Fluent::FlowCounterOutput < Fluent::Output
|
|
122
123
|
|
123
124
|
def tagged_flush(step)
|
124
125
|
flushed,@counts = @counts,count_initialized(@counts.keys)
|
125
|
-
names = flushed.keys.select {|x| x.end_with?('
|
126
|
+
names = flushed.keys.select {|x| x.end_with?(delimiter + 'count')}.map {|x| x.chomp(delimiter + 'count')}
|
126
127
|
names.map {|name|
|
127
128
|
counts = {
|
128
|
-
'count' => flushed[name + '
|
129
|
-
'bytes' => flushed[name + '
|
129
|
+
'count' => flushed[name + delimiter + 'count'],
|
130
|
+
'bytes' => flushed[name + delimiter + 'bytes'],
|
130
131
|
}
|
131
132
|
data = generate_output(counts, step)
|
132
133
|
data['tag'] = name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-flowcounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -98,3 +98,4 @@ summary: Fluent plugin to count message flow
|
|
98
98
|
test_files:
|
99
99
|
- test/helper.rb
|
100
100
|
- test/plugin/test_out_flowcounter.rb
|
101
|
+
has_rdoc:
|