fluent-plugin-rds-mysql-slow-log 0.2.0 → 0.3.0

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: 565605f86cec00568451e93b04477c06b39fa2a1
4
- data.tar.gz: 8df2f6f5be0e42f8581f93da60fc5b2dd013d797
3
+ metadata.gz: 0e0a699c12abf9d3cc2561b5824b98c7369f2055
4
+ data.tar.gz: f6e12a8ac64a0bde9adfe69613295f47f9c82978
5
5
  SHA512:
6
- metadata.gz: d673c80ab5c6c3e4496e31719f0dccc6bb67c723b729376b647f455b7a8a1c36dcb11a5f78af5986250de4b53275e9c3c587d261ed00ae9b150caa29ab5b0eb6
7
- data.tar.gz: bbfae2a34b504d8ef866ad18955ec792600275d60d4f35354858bb488ce86e997489a9d322a70f9e8b7df0e5ecb77934352af7bacc12a6306c3ba32d1a1659fd
6
+ metadata.gz: ffecc0aeb404b94be8f235aeb0ec324b9205feff87f9703903f9952d05128260553a443ccca1a74fa779bdc27cf2b2ef80568c83f8241d4f712198455d5f8b29
7
+ data.tar.gz: b1f2f5eb77d87a325a44363496d43a25ef5aa3f2d005f5a4c2978d6fb589f5fa3075a44ca26f81e81cf8090b850b7d4e87cf11458c1f46e08fa8c936f97ac0fc
data/README.md CHANGED
@@ -32,7 +32,6 @@ 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
36
35
  tag_prefix slow_log
37
36
  <server>
38
37
  host db1.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com
@@ -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.2.0'
8
+ spec.version = '0.3.0'
9
9
  spec.authors = ['Satoshi Matsumoto']
10
10
  spec.email = ['kaorimatz@gmail.com']
11
11
 
@@ -14,7 +14,6 @@ module Fluent
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.'
18
17
  config_param :tag_prefix, :string, default: nil, desc: 'The prefix of the tag.'
19
18
  config_section :server, param_name: :servers, required: true do
20
19
  config_param :host, :string, desc: 'The IP address or hostname of the server.'
@@ -82,7 +81,6 @@ module Fluent
82
81
 
83
82
  def on_timer
84
83
  @servers.each.with_index do |(tag, server), i|
85
- sleep @rotate_interval if @rotate_interval && !i.nonzero?
86
84
  emit_slow_log(tag, server)
87
85
  end
88
86
  end
@@ -152,8 +150,9 @@ module Fluent
152
150
  end
153
151
 
154
152
  def time_to_microseconds(time)
155
- hour, min, sec, usec = time.scanf('%2u:%2u:%2u.%6u')
156
- hour * 3_600_000_000 + min * 60_000_000 + sec * 1_000_000 + usec.to_i
153
+ hour, min, sec, usec = time.scanf('%4d:%2u:%2u.%6u')
154
+ sign = hour < 0 ? -1 : 1
155
+ (hour.abs * 3_600_000_000 + min * 60_000_000 + sec * 1_000_000 + usec.to_i) * sign
157
156
  end
158
157
 
159
158
  def process_integer(record)
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.2.0
4
+ version: 0.3.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-17 00:00:00.000000000 Z
11
+ date: 2017-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd