fluent-plugin-rds-mysql-slow-log 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/fluent-plugin-rds-mysql-slow-log.gemspec +1 -1
- data/lib/fluent/plugin/in_rds_mysql_slow_log.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565605f86cec00568451e93b04477c06b39fa2a1
|
4
|
+
data.tar.gz: 8df2f6f5be0e42f8581f93da60fc5b2dd013d797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d673c80ab5c6c3e4496e31719f0dccc6bb67c723b729376b647f455b7a8a1c36dcb11a5f78af5986250de4b53275e9c3c587d261ed00ae9b150caa29ab5b0eb6
|
7
|
+
data.tar.gz: bbfae2a34b504d8ef866ad18955ec792600275d60d4f35354858bb488ce86e997489a9d322a70f9e8b7df0e5ecb77934352af7bacc12a6306c3ba32d1a1659fd
|
data/README.md
CHANGED
@@ -32,6 +32,7 @@ Or install it yourself as:
|
|
32
32
|
from_encoding shift_jis
|
33
33
|
keep_time_key
|
34
34
|
null_empty_string
|
35
|
+
rotate_interval 1
|
35
36
|
tag_prefix slow_log
|
36
37
|
<server>
|
37
38
|
host db1.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com
|
@@ -63,3 +64,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/kaorim
|
|
63
64
|
## License
|
64
65
|
|
65
66
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
67
|
+
|
68
|
+
## Acknowledgement
|
69
|
+
|
70
|
+
The idea of calling `mysql.rds_rotate_slow_log` for collecting slow log entries is borrowed from [fluent-plugin-rds-slowlog](https://github.com/kenjiskywalker/fluent-plugin-rds-slowlog).
|
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'fluent-plugin-rds-mysql-slow-log'
|
8
|
-
spec.version = '0.
|
8
|
+
spec.version = '0.2.0'
|
9
9
|
spec.authors = ['Satoshi Matsumoto']
|
10
10
|
spec.email = ['kaorimatz@gmail.com']
|
11
11
|
|
@@ -9,11 +9,12 @@ module Fluent
|
|
9
9
|
Plugin.register_input('rds_mysql_slow_log', self)
|
10
10
|
|
11
11
|
config_param :database_timezone, :string, default: nil, desc: 'The timezone of the database.'
|
12
|
-
config_param :emit_interval, :time, default:
|
12
|
+
config_param :emit_interval, :time, default: 60, desc: 'The interval in seconds to emit records.'
|
13
13
|
config_param :encoding, :string, default: nil, desc: 'The encoding of strings in an emitted record.'
|
14
14
|
config_param :from_encoding, :string, default: nil, desc: 'The encoding of sql_text data.'
|
15
15
|
config_param :keep_time_key, :bool, default: false, desc: 'Keep the time key in an emitted record.'
|
16
16
|
config_param :null_empty_string, :bool, default: false, desc: 'Convert empty strings to null.'
|
17
|
+
config_param :rotate_interval, :time, default: nil, desc: 'The interval in seconds between subsequent rotations of slow_log tables across servers.'
|
17
18
|
config_param :tag_prefix, :string, default: nil, desc: 'The prefix of the tag.'
|
18
19
|
config_section :server, param_name: :servers, required: true do
|
19
20
|
config_param :host, :string, desc: 'The IP address or hostname of the server.'
|
@@ -80,7 +81,8 @@ module Fluent
|
|
80
81
|
end
|
81
82
|
|
82
83
|
def on_timer
|
83
|
-
@servers.each do |tag, server|
|
84
|
+
@servers.each.with_index do |(tag, server), i|
|
85
|
+
sleep @rotate_interval if @rotate_interval && !i.nonzero?
|
84
86
|
emit_slow_log(tag, server)
|
85
87
|
end
|
86
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-rds-mysql-slow-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|