-
Notifications
You must be signed in to change notification settings - Fork 803
Fix slave status parsing #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mysqld_exporter.go
Outdated
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.
interface{} means any type (like Object in Java), so I think you should be able to use slaveData directly in the rows.Scan.
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.
I know what interface{} means ;)
I guess this response means I should have added a comment here. The reason I do this is because rows.Scan() needs a pointer to an object rather than the object itself. &slaveData would give a pointer to the slice of byteslices, when what we need is for each element of slaveData to be a pointer. Creating a slice of interfaces, with each element being a pointer to the underlying sql.NullByte is a simple and fairly standard way of doing this.
Does that clarify it?
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.
Yes, would make([]*sql.RawBytes, len(slaveCols) do the same job then?
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.
Sadly not - []*sql.RawBytes doesn't satisfy []interface{}.
|
LGTM |
|
👍 Can you squash the commits? |
Includes all numeric and Yes/No items.
|
Done. Thanks. |
# This is the 1st commit message: Move session params to DSN (prometheus#259) * Move session params to DSN In order to avoid lost session params if the `db` object reconnects in the background, move session params to the DSN string configuration. * Move log_slow_filter flag to exporter * Update flag name to be in `exporter` namespace. * Update README. * Tweak exporter.log_slow_filter flag documentation. # This is the commit message prometheus#2: Fix lock_wait_timeout after prometheus#259 (prometheus#263) # This is the commit message prometheus#3: Broken landing page, doesn't include metric path. (prometheus#264) * Broken landing page, doesn't include metric path. * Fix landing page. # This is the commit message prometheus#4: first commit Signed-off-by: Roi Ezra <ezraroi@gmail.com> # This is the commit message prometheus#5: fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com> # This is the commit message prometheus#6: fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com>
Basic MyRocks support (PMM-1290)
Fixes slave status parsing. As it supports variable column widths, this should work on all 5.x versions of mysql/mariadb. No promises about 4.x.
Also cleaned up log files - removing an extraneous space between description and error.