proxysql_query_log-parser 0.0.2 → 0.0.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a8e1aa363f5f9ceb7939acbc2c81d279d9c68727ccba49398a067942c6f8cd
|
4
|
+
data.tar.gz: d8d882f082e4ad02d7d89236aec57363b72f2c9ba087d5382a4761c4464d4a48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfea8ec9fd34500d72d2cdfed032a20b60595afcf16a8f3ee6927e8c59dfb737df669b454ceaa35c3257fe69187aca1c3f8fc0eac73c3f53cf83c5bd633ed1b8
|
7
|
+
data.tar.gz: 1f20f70b26c24d3d3dd7afd347682990ef31461b4785817a3c3d87ce026bb81f6b69d9b1a1f350c093529dc021718b494a918d24024c1ccb47bb80cf541ef685
|
@@ -9,12 +9,9 @@ module ProxysqlQueryLog
|
|
9
9
|
queries = []
|
10
10
|
|
11
11
|
while true
|
12
|
-
raw_total_bytes = io.read(
|
12
|
+
raw_total_bytes = io.read(8)
|
13
13
|
break unless raw_total_bytes
|
14
|
-
|
15
|
-
io.seek(7, IO::SEEK_CUR)
|
16
|
-
raw = io.read(total_bytes)
|
17
|
-
queries << parse(StringIO.new(raw, 'r+'))
|
14
|
+
queries << parse(io)
|
18
15
|
end
|
19
16
|
queries
|
20
17
|
end
|
@@ -27,7 +24,9 @@ module ProxysqlQueryLog
|
|
27
24
|
q.schema_name = parse_schema_name(io)
|
28
25
|
q.client = parse_client(io)
|
29
26
|
q.hid = parse_hid(io)
|
30
|
-
q.
|
27
|
+
unless q.hid == UINT64_MAX
|
28
|
+
q.server = parse_server(io)
|
29
|
+
end
|
31
30
|
q.start_time = parse_start_time(io)
|
32
31
|
q.end_time = parse_end_time(io)
|
33
32
|
q.digest = parse_digest(io)
|
@@ -98,12 +97,20 @@ module ProxysqlQueryLog
|
|
98
97
|
end
|
99
98
|
|
100
99
|
def read_encoded_length(io)
|
101
|
-
buf = io.read(1).
|
102
|
-
len = mysql_decode_length(buf
|
100
|
+
buf = io.read(1).unpack1('C')
|
101
|
+
len = mysql_decode_length(buf)
|
103
102
|
unless len == 0
|
104
|
-
buf2 =
|
105
|
-
|
106
|
-
|
103
|
+
buf2 = case len
|
104
|
+
when 1
|
105
|
+
buf
|
106
|
+
when 3
|
107
|
+
(io.read(len-1) + ("\x00" * (9 - len))).unpack1('Q*')
|
108
|
+
when 4
|
109
|
+
(io.read(3) + ("\x00")).unpack1('l*')
|
110
|
+
when 9
|
111
|
+
io.read(8).unpack1('Q*')
|
112
|
+
end
|
113
|
+
return buf2
|
107
114
|
end
|
108
115
|
end
|
109
116
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxysql_query_log-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- r_takaishi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|