Slave lag throttler symbolize config keys#55
Merged
Conversation
Author
Also, don't use a method definition where a variable will do.
|
Thanks for your contribution here! ❤️ I've tacked on a bit of polish as well. I'm happy with it, but now that I'm involved, I'm going to get an extra set of eyes on it. |
insom
approved these changes
Sep 4, 2018
| log_messages = @logs.string.lines | ||
| assert_equal(2, log_messages.length) | ||
| assert log_messages[0].include? "Connecting to slave on database: db" | ||
| assert log_messages[1].include? "Error connecting to slave: Unknown MySQL server host 'slave'" |
|
Will cut a new version of this gem shortly with this PR. |
|
A new release has been cut. Thanks again! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Billing team was trying to use the Slave Lag Throttler to run some LHMs and it wasn't behaving as expected. While investigating, we noticed a log statement like:
"
Connecting to 35.***.***.31 on database:"which made us think that the
configwas missing thedatabaseentry. Turns out it was just the log statement that was incorrect/misleading (config['database']vsconfig[:database]).I am proposing to fix this by symbolizing the keys in the config and using symbols to access the values.
I added a test and also refactored a couple of the existing tests since the assertions in those tests were not being executed.