-
Notifications
You must be signed in to change notification settings - Fork 188
debug-tools: Binlog event blackhole #235
debug-tools: Binlog event blackhole #235
Conversation
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
===========================================
Coverage 57.4825% 57.4825%
===========================================
Files 160 160
Lines 16191 16191
===========================================
Hits 9307 9307
Misses 5970 5970
Partials 914 914 |
When exiting, the result will be output to the log as following | ||
|
||
```log | ||
[2019/08/12 15:44:19.269 +08:00] [INFO] [main.go:95] ["binlog-event-blackhole exit"] [event-count=35] [byte-count=2360] [duration=705.627314ms] [tps=49.601254522865595] ["speed (byte/s)"=3344.541733541794] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2019/08/12 15:44:19.269 +08:00] [INFO] [main.go:95] ["binlog-event-blackhole exit"] [event-count=35] [byte-count=2360] [duration=705.627314ms] [tps=49.601254522865595] ["speed (byte/s)"=3344.541733541794] | |
[2019/08/12 15:44:19.269 +08:00] [INFO] [main.go:95] ["binlog-event-blackhole exit"] [event-count=35] [byte-count=2360] [duration=705.627314ms] [tps=49.601254522865595] ["throughput (byte/s)"=3344.541733541794] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 50c2b56
| byte-count | The total bytes have received from the upstream master | | ||
| duration | The duration has be taken to fetch binlog events | | ||
| tps | The events have received per second | | ||
| speed | The speed of fetching binlog event data (bytes/second) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| speed | The speed of fetching binlog event data (bytes/second) | | |
| throughput | The throughput of fetching binlog event data (bytes/second) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 50c2b56
} | ||
|
||
// readEventsWithGoMySQL reads binlog events from the master server with `go-mysql` pkg. | ||
func readEventsWithGoMySQL(ctx context.Context, conn *client.Conn) (uint64, uint64, time.Duration, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the differences with readEventsWithoutGoMySQL
is the "github.com/siddontang/go-mysql/client".Conn
use a buffer, I originally thought that it also contains more logic, such as decoding/parsing.
Let's do this now, you can add the complete go-mysql
logic later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh. after doing some benchmark later, I think more (fine-grained) things we can do.
speed := float64(byteCount) / duration.Seconds() | ||
log.L().Info("binlog-event-blackhole exit", | ||
zap.Uint64("event-count", eventCount), zap.Uint64("byte-count", byteCount), | ||
zap.Duration("duration", duration), zap.Float64("tps", tps), zap.Float64("speed (byte/s)", speed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zap.Duration("duration", duration), zap.Float64("tps", tps), zap.Float64("speed (byte/s)", speed)) | |
zap.Duration("duration", duration), zap.Float64("tps", tps), zap.Float64("throughput (byte/s)", speed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 50c2b56.
Rest LGTM |
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
1 similar comment
/run-all-tests tidb=release-3.0 |
What problem does this PR solve?
add a binlog-event-blackhole tool to test the speed of fetching binlog event.
What is changed and how it works?
add a binlog-event-blackhole tool.
Check List
Tests
for more information, see README.md under the binlog-event-blackhole folder.