fluent-plugin-redis-multi-type-counter 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/benchmark/performance_test.rb +1 -1
- data/fluent-plugin-redis-multi-type-counter.gemspec +1 -1
- data/lib/fluent/plugin/{out_redis_counter.rb → out_redis_multi_type_counter.rb} +9 -9
- data/test/plugin/{out_redis_counter.rb → out_redis_multi_type_counter.rb} +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 936238a72c8d962c1069ee120d0ef01f18f284c8
|
4
|
+
data.tar.gz: f3ef9d5150a711d790b3cf995f5fdfd03384c82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef17b10d2221df4eb2937473969fe941b707c41d29bd964474a7977e52445e66a44a301e6ba09805580f5d3763bd32e180b53f38dce7192ba7f3dcf67a2e04ac
|
7
|
+
data.tar.gz: 3bccb55ec9a19268492153a7978c75af64c44c85df74a5266e2937108fbc0b96de4e0e5e02e2b37b33d8d3c2cef27c46f163c7b8d7bad7df01338a72d580b9cf
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Redis multi-type counter plugin for fluent [![Build Status](https://
|
1
|
+
# Redis multi-type counter plugin for fluent [![Build Status](https://travis-ci.org/HeartSaVioR/fluent-plugin-redis-multi-type-counter.png)](https://travis-ci.org/HeartSaVioR/fluent-plugin-redis-multi-type-counter)
|
2
2
|
|
3
3
|
fluent-plugin-redis-multi-type-counter is a fluent plugin to count-up/down redis keys, hash, sorted set.
|
4
4
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -6,7 +6,7 @@ require 'ruby-prof'
|
|
6
6
|
end
|
7
7
|
|
8
8
|
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
|
9
|
-
require 'fluent/plugin/
|
9
|
+
require 'fluent/plugin/out_redis_multi_type_counter'
|
10
10
|
|
11
11
|
module PerformanceTestApp
|
12
12
|
class Benchmarker
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-redis-multi-type-counter"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.2"
|
7
7
|
s.description = "fluent-plugin-redis-multi-type-counter is a fluent plugin to count-up/down redis keys, hash keys, zset keys"
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Jungtaek Lim"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fluent
|
2
|
-
class
|
3
|
-
Fluent::Plugin.register_output('
|
2
|
+
class RedisMultiTypeCounterOutput < BufferedOutput
|
3
|
+
Fluent::Plugin.register_output('redis_multi_type_counter', self)
|
4
4
|
attr_reader :host, :port, :db_number, :password, :redis, :patterns
|
5
5
|
|
6
6
|
config_param :max_pipelining, :integer, :default => 1000
|
@@ -23,7 +23,7 @@ module Fluent
|
|
23
23
|
}.each { |element|
|
24
24
|
begin
|
25
25
|
@patterns << Pattern.new(element)
|
26
|
-
rescue
|
26
|
+
rescue RedisMultiTypeCounterException => e
|
27
27
|
raise Fluent::ConfigError, e.message
|
28
28
|
end
|
29
29
|
}
|
@@ -114,7 +114,7 @@ module Fluent
|
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
|
-
class
|
117
|
+
class RedisMultiTypeCounterException < Exception
|
118
118
|
end
|
119
119
|
|
120
120
|
class RecordValueFormatter
|
@@ -137,17 +137,17 @@ module Fluent
|
|
137
137
|
|
138
138
|
def initialize(conf_element)
|
139
139
|
if !conf_element.has_key?('count_key') && !conf_element.has_key?('count_key_format')
|
140
|
-
raise
|
140
|
+
raise RedisMultiTypeCounterException, '"count_key" or "count_key_format" is required.'
|
141
141
|
end
|
142
142
|
if conf_element.has_key?('count_key') && conf_element.has_key?('count_key_format')
|
143
|
-
raise
|
143
|
+
raise RedisMultiTypeCounterException, 'both "count_key" and "count_key_format" are specified.'
|
144
144
|
end
|
145
145
|
|
146
146
|
if conf_element.has_key?('count_key')
|
147
147
|
@count_key = conf_element['count_key']
|
148
148
|
else
|
149
149
|
if conf_element.has_key?('localtime') && conf_element.has_key?('utc')
|
150
|
-
raise
|
150
|
+
raise RedisMultiTypeCounterException, 'both "localtime" and "utc" are specified.'
|
151
151
|
end
|
152
152
|
is_localtime = true
|
153
153
|
if conf_element.has_key?('utc')
|
@@ -158,7 +158,7 @@ module Fluent
|
|
158
158
|
end
|
159
159
|
|
160
160
|
if conf_element.has_key?('count_hash_key_format') && conf_element.has_key?('count_zset_key_format')
|
161
|
-
raise
|
161
|
+
raise RedisMultiTypeCounterException, 'both "count_hash_key_format" "count_zset_key_format" are specified.'
|
162
162
|
end
|
163
163
|
|
164
164
|
if conf_element.has_key?('count_hash_key_format')
|
@@ -183,7 +183,7 @@ module Fluent
|
|
183
183
|
begin
|
184
184
|
@count_value = Integer(conf_element['count_value'])
|
185
185
|
rescue
|
186
|
-
raise
|
186
|
+
raise RedisMultiTypeCounterException, 'invalid "count_value", integer required.'
|
187
187
|
end
|
188
188
|
end
|
189
189
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'fluent/test'
|
2
2
|
|
3
|
-
class
|
3
|
+
class RedisMultiTypeCounterTest < Test::Unit::TestCase
|
4
4
|
def setup
|
5
5
|
Fluent::Test.setup
|
6
|
-
require 'fluent/plugin/
|
6
|
+
require 'fluent/plugin/out_redis_multi_type_counter'
|
7
7
|
|
8
8
|
@d = create_driver %[
|
9
9
|
host localhost
|
@@ -24,7 +24,7 @@ class RedisCounterTest < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def create_driver(conf = CONFIG)
|
27
|
-
Fluent::Test::BufferedOutputTestDriver.new(Fluent::
|
27
|
+
Fluent::Test::BufferedOutputTestDriver.new(Fluent::RedisMultiTypeCounterOutput).configure(conf)
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_configure
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-redis-multi-type-counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jungtaek Lim
|
@@ -54,8 +54,8 @@ files:
|
|
54
54
|
- VERSION
|
55
55
|
- benchmark/performance_test.rb
|
56
56
|
- fluent-plugin-redis-multi-type-counter.gemspec
|
57
|
-
- lib/fluent/plugin/
|
58
|
-
- test/plugin/
|
57
|
+
- lib/fluent/plugin/out_redis_multi_type_counter.rb
|
58
|
+
- test/plugin/out_redis_multi_type_counter.rb
|
59
59
|
homepage: https://github.com/heartsavior/fluent-plugin-redis-multi-type-counter
|
60
60
|
licenses:
|
61
61
|
- APACHE2
|
@@ -81,4 +81,4 @@ signing_key:
|
|
81
81
|
specification_version: 4
|
82
82
|
summary: Redis multi type counter plugin for fluent
|
83
83
|
test_files:
|
84
|
-
- test/plugin/
|
84
|
+
- test/plugin/out_redis_multi_type_counter.rb
|