fluent-plugin-flowcounter 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 371f1e2ee7a6a62d3b4a3e2909c60538b24232ed
4
- data.tar.gz: d54a1744d139dd4d0b5d5ee763911b03f7ba1170
3
+ metadata.gz: 7da7181ad46b9c8a8b331ed86079f4789312b357
4
+ data.tar.gz: da8fcc029b68158e94c51d33e47d11c1fdbdb30a
5
5
  SHA512:
6
- metadata.gz: c6ae23f89eced80c2a730296e573fea17a9014495821c33e826c85f676cf7b19d4aae4d59d5a77e0ee8bef8d9ad65fbd85cdde08da2e364dd260e2ecbc7cff1d
7
- data.tar.gz: 0db64efbdd2df02c80792ee20ed756f8a017db604bee08403fe0dd558d1f4ee3ee3b990982b3436ede57d48e58cb2decdf9a23d31ccfaa13379a2d862a945409
6
+ metadata.gz: 006edff727622d81fe15799ce739866a748b36b0ff789edeb15233580e54ef48570530806f8a6105cff5e8804939dd7b8ac9c5a177ea00fd5389d16a0506827f
7
+ data.tar.gz: c5138f42f9cfcdce1b2c1976c8ee80d5134632a98db059f636cf291591c23f47fafe12b488148381e65a6c40a7c27f0f6fdf68ea4653b412a30e345f35d1620d
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  rvm:
4
- - 2.0.0
5
4
  - 2.1
6
5
  - 2.2
7
6
  - 2.3.0
data/README.md CHANGED
@@ -89,6 +89,15 @@ Use '${hostname}' if you want your hostname in tag.
89
89
  tag fluentd.node.${hostname}
90
90
  </match>
91
91
 
92
+ Counts active tag, stop count records if the tag message stoped(when aggragates per tag).
93
+
94
+ <match target.**>
95
+ @type flowcounter
96
+ count_keys *
97
+ aggregate tag
98
+ delete_idle true
99
+ </match>
100
+
92
101
  ## TODO
93
102
 
94
103
  * consider what to do next
@@ -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.4.1"
4
+ gem.version = "0.4.2"
5
5
  gem.authors = ["TAGOMORI Satoshi"]
6
6
  gem.email = ["tagomoris@gmail.com"]
7
7
  gem.summary = %q{Fluent plugin to count message flow}
@@ -20,6 +20,7 @@ class Fluent::FlowCounterOutput < Fluent::Output
20
20
  config_param :input_tag_remove_prefix, :string, default: nil
21
21
  config_param :count_keys, :string, default: nil
22
22
  config_param :delimiter, :string, default: '_'
23
+ config_param :delete_idle, :bool, default: false
23
24
 
24
25
  include Fluent::Mixin::ConfigPlaceholders
25
26
 
@@ -126,12 +127,14 @@ class Fluent::FlowCounterOutput < Fluent::Output
126
127
  end
127
128
 
128
129
  def flush(step)
129
- flushed,@counts = @counts,count_initialized(@counts.keys)
130
+ keys = delete_idle ? nil : @counts.keys
131
+ flushed,@counts = @counts,count_initialized(keys)
130
132
  generate_output(flushed, step)
131
133
  end
132
134
 
133
135
  def tagged_flush(step)
134
- flushed,@counts = @counts,count_initialized(@counts.keys)
136
+ keys = delete_idle ? nil : @counts.keys
137
+ flushed,@counts = @counts,count_initialized(keys)
135
138
  names = flushed.keys.select {|x| x.end_with?(delimiter + 'count')}.map {|x| x.chomp(delimiter + 'count')}
136
139
  names.map {|name|
137
140
  counts = {
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake