mysql_binlog 0.3.6 → 0.3.7
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.
- checksums.yaml +5 -5
- data/bin/mysql_binlog_summary +21 -2
- data/lib/mysql_binlog/binlog_event_parser.rb +2 -0
- data/lib/mysql_binlog/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 68751dcb93a315960a1ea2ec299a9f26eef45678d58828ccd423c4140bbb6636
|
4
|
+
data.tar.gz: 2ccb823feaf7f0bc50912ecfb9e08c4f8bb44a14dd4e72c88acb60485ad2a2f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50d4c8cb1385c63e6a74ab825f71691cbefbbe66c73786462d690750bd64c8d919c63aa5d3c564c8b8d46d10741a82abe754f482e77416b3ff5c7e1f368abd41
|
7
|
+
data.tar.gz: 381f7c4302b0a8d0964e4fcd1b3bcf034ca4401bd6fc68e78768ae7a53931a70b36d7ff2486f72464fd6d5598c0b2723ee375ff762b76efb8647776855cb1c4c
|
data/bin/mysql_binlog_summary
CHANGED
@@ -129,6 +129,7 @@ events_processed = 0
|
|
129
129
|
|
130
130
|
events << {
|
131
131
|
timestamp: timestamp,
|
132
|
+
size: event[:header][:payload_length],
|
132
133
|
type: event[:type],
|
133
134
|
verb: verb,
|
134
135
|
table: table,
|
@@ -182,6 +183,8 @@ puts
|
|
182
183
|
|
183
184
|
events_by_type = Hash.new(0)
|
184
185
|
events_by_verb_and_table = {}
|
186
|
+
size_by_verb_and_table = {}
|
187
|
+
size_by_table = Hash.new(0)
|
185
188
|
net_change_by_verb_and_table = {}
|
186
189
|
net_change_by_table = Hash.new(0)
|
187
190
|
events.each do |event|
|
@@ -189,6 +192,9 @@ events.each do |event|
|
|
189
192
|
if event[:verb]
|
190
193
|
events_by_verb_and_table[event[:verb]] ||= Hash.new(0)
|
191
194
|
events_by_verb_and_table[event[:verb]][event[:table]] += 1
|
195
|
+
size_by_verb_and_table[event[:verb]] ||= Hash.new(0)
|
196
|
+
size_by_verb_and_table[event[:verb]][event[:table]] += event[:size]
|
197
|
+
size_by_table[event[:table]] += event[:size]
|
192
198
|
net_change_by_verb_and_table[event[:verb]] ||= Hash.new(0)
|
193
199
|
net_change_by_verb_and_table[event[:verb]][event[:table]] += event[:net_change]
|
194
200
|
net_change_by_table[event[:table]] += event[:net_change]
|
@@ -204,15 +210,27 @@ puts
|
|
204
210
|
puts "Events by verb and table:"
|
205
211
|
events_by_verb_and_table.sort.each do |verb, table_and_count|
|
206
212
|
puts "%s\n" % [verb]
|
213
|
+
puts " %-50s%10s%14s%14s%14s" % [
|
214
|
+
"", "Count", "Rate/s", "Net (KiB/s)", "Size (KiB/s)"
|
215
|
+
]
|
207
216
|
table_and_count.sort { |a, b| b[1] <=> a[1] }.each do |table, count|
|
208
|
-
puts " %-50s%10d%
|
209
|
-
table, count, count.to_f / duration.to_f,
|
217
|
+
puts " %-50s%10d%14s%+14.2f%14.2f" % [
|
218
|
+
table, count, "%10.2f/s" % [count.to_f / duration.to_f],
|
210
219
|
net_change_by_verb_and_table[verb][table] / 1024.0 / duration.to_f,
|
220
|
+
size_by_verb_and_table[verb][table] / 1024.0 / duration.to_f,
|
211
221
|
]
|
212
222
|
end
|
213
223
|
puts
|
214
224
|
end
|
215
225
|
|
226
|
+
puts "Event payload by table (top 10):"
|
227
|
+
size_by_table.sort { |a, b| b[1].abs <=> a[1].abs }.first(10).each do |table, size|
|
228
|
+
puts " %-50s%+10.2f KiB/s" % [
|
229
|
+
table, size.to_f / 1024.0 / duration.to_f
|
230
|
+
]
|
231
|
+
end
|
232
|
+
puts
|
233
|
+
|
216
234
|
puts "Net change by table (top 10):"
|
217
235
|
net_change_by_table.sort { |a, b| b[1].abs <=> a[1].abs }.first(10).each do |table, net_change|
|
218
236
|
puts " %-50s%+10.2f KiB/s" % [
|
@@ -220,3 +238,4 @@ net_change_by_table.sort { |a, b| b[1].abs <=> a[1].abs }.first(10).each do |tab
|
|
220
238
|
]
|
221
239
|
end
|
222
240
|
puts
|
241
|
+
|
data/lib/mysql_binlog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_binlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Library for parsing MySQL binary logs in Ruby
|
14
14
|
email: jeremy@jcole.us
|
@@ -48,8 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
|
52
|
-
rubygems_version: 2.5.2.3
|
51
|
+
rubygems_version: 3.1.4
|
53
52
|
signing_key:
|
54
53
|
specification_version: 4
|
55
54
|
summary: MySQL Binary Log Parser
|