fluent-plugin-eventcounter 0.0.4 → 0.0.4.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.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-eventcounter"
4
- gem.version = "0.0.4"
4
+ gem.version = "0.0.4.1"
5
5
  gem.authors = ["Sean Dick", "Change.org"]
6
6
  gem.email = ["sean@change.org"]
7
7
  gem.homepage = "https://github.com/change/fluent-plugin-eventcounter"
@@ -17,7 +17,7 @@ class Fluent::EventCounterOutput < Fluent::BufferedOutput
17
17
  config_param :input_tag_exclude, :string, :default => ''
18
18
  config_param :capture_extra_if, :string, :default => nil
19
19
  config_param :capture_extra_replace, :string, :default => ''
20
- config_param :debug_emit, :boolean, :default => false
20
+ config_param :debug_emit, :bool, :default => false
21
21
 
22
22
  config_param :count_key, :string # REQUIRED
23
23
 
@@ -59,12 +59,7 @@ class Fluent::EventCounterOutput < Fluent::BufferedOutput
59
59
  counts[key][event] += 1
60
60
  end
61
61
  end
62
- if @debug_emit || @emit_only
63
- counts.each do |tag, events|
64
- Fluent::Engine.emit(@emit_to, Time.now, tag => events)
65
- end
66
- return if @emit_only
67
- end
62
+
68
63
  @redis.pipelined do
69
64
  counts.each do |tag,events|
70
65
  events.each do |event, c|
@@ -72,6 +67,13 @@ class Fluent::EventCounterOutput < Fluent::BufferedOutput
72
67
  @redis.hincrby(redis_key, event, c.to_i)
73
68
  end
74
69
  end
70
+ end unless @emit_only
71
+
72
+ if @emit_only || @debug_emit
73
+ counts.each do |tag, events|
74
+ Fluent::Engine.emit(@emit_to, Time.now, tag => events)
75
+ end
75
76
  end
77
+
76
78
  end
77
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-eventcounter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: