Skip to content

Conversation

@jtorkkel
Copy link
Contributor

@jtorkkel jtorkkel commented Apr 7, 2020

Fix for
#371

@oliver006
Copy link
Owner

Thanks for the PR!
I'm slammed with work stuff this week but I'll try to get to it later this week.

Also, turns out I had Drone (the CI pipeline) for PRs turned off, oops. I turned it back on, could you please give this a little bump to trigger the pipeline and run tests, etc? Thanks!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 82.384% when pulling 63ac573 on jtorkkel:multiple-master into 74757c5 on oliver006:master.

@codecov
Copy link

codecov bot commented Apr 8, 2020

Codecov Report

Merging #372 into master will increase coverage by 0.28%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
+ Coverage   78.64%   78.92%   +0.28%     
==========================================
  Files           2        2              
  Lines         899      911      +12     
==========================================
+ Hits          707      719      +12     
  Misses        157      157              
  Partials       35       35              
Impacted Files Coverage Δ
exporter.go 88.54% <95.23%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74757c5...4078896. Read the comment docs.

Copy link
Owner

@oliver006 oliver006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two smaller issues/questions but generally looks good, thanks for the PR!

exporter.go Outdated
slaveInfoFields = map[string]bool{"master_host": true, "master_port": true, "slave_read_only": true}
)

if strings.HasPrefix(fieldKey, "master_host") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the snippet you posted in #371 it looks like this will occur in the # Replication section so maybe only pick these up while in the fieldClass == "Replication" section down starting line 810?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why HasPrefix and not match it exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can simplify it.

exporter.go Outdated
}
return true
}
if fieldKey == "master_last_io_seconds_ago" || fieldKey == "slave_repl_offset" || fieldKey == "master_sync_in_progress" {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you redo this if statement with the one from line 714 and make it a switch on fieldKey?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change to switch

@oliver006
Copy link
Owner

Thanks for the changes! Two issues or questions:

  1. what's up with PR Three if statement refactoring #374 ? Do you wamnt to proceed with this one or Three if statement refactoring #374 ?
  2. there seems to be a go fmt issue

@jtorkkel
Copy link
Contributor Author

Hi, I made some mistakes and ended deleting my branch and making new pull request #374
So please proceed with 374, it should pass fmt.
Otherwise they are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants