Skip to content
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

Add httpReq to placement source (debug) #1981

Merged
merged 6 commits into from
Oct 14, 2019
Merged

Conversation

benraskin92
Copy link
Collaborator

What this PR does / why we need it:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@codecov
Copy link

codecov bot commented Oct 4, 2019

Codecov Report

Merging #1981 into master will increase coverage by 3.4%.
The diff coverage is 51.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1981     +/-   ##
=========================================
+ Coverage    60.1%    63.6%   +3.4%     
=========================================
  Files        1120     1122      +2     
  Lines      106270   106531    +261     
=========================================
+ Hits        63956    67790   +3834     
+ Misses      38286    34413   -3873     
- Partials     4028     4328    +300
Flag Coverage Δ
#aggregator 79.7% <ø> (ø) ⬆️
#cluster 56.3% <100%> (ø) ⬆️
#collector 63.7% <ø> (ø) ⬆️
#dbnode 65% <62.9%> (ø) ⬆️
#m3em 59.6% <ø> (ø) ⬆️
#m3ninx 61.1% <ø> (ø) ⬆️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 17.7% <ø> (ø) ⬆️
#msg 74.9% <ø> (ø) ⬆️
#query 68.6% <40.1%> (+19.4%) ⬆️
#x 75% <93.1%> (ø) ⬆️

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 1260780...67abd5f. Read the comment docs.

@benraskin92 benraskin92 changed the title [WIP] Add httpReq to placement source (debug) Add httpReq to placement source (debug) Oct 4, 2019
func (p *placementInfoSource) Write(w io.Writer) error {
placement, _, err := p.getHandler.Get(p.serviceName, nil)
func (p *placementInfoSource) Write(w io.Writer, httpReq *http.Request) error {
placement, _, err := p.getHandler.Get(p.serviceName, httpReq)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey I was going to comment on this and say we really should just be flowing defaults all the way from the DB Node and/or the coordinator to all service related endpoints (as well as supporting the headers just in case you want to override it).

Anyway I went ahead and did this, now basically you don't need a special header, if you hit the DB node coordinator endpoint, or even just the default debug dump on the debug address HTTP server, it'll just return you whatever the current config is configured for:
#1984

If you're good to go ahead with this, let's merge my pull request into your branch (by just using the merge button on that PR) and then maybe you could help fix up the tests and then get the resulting PR here merged into master?

@benraskin92 benraskin92 force-pushed the braskin/fix_debug branch 3 times, most recently from 9507918 to b403aa4 Compare October 8, 2019 20:55
}

// ServiceOptionsDefaults is the defaults for optional service options.
type ServiceOptionsDefaults struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Heh this is probably my bad - I think this isn't used anymore, perhaps remove this struct?

Copy link
Collaborator

@robskillington robskillington left a comment

Choose a reason for hiding this comment

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

LGTM other than the comment about removing the unused struct

@benraskin92 benraskin92 merged commit 898b352 into master Oct 14, 2019
@benraskin92 benraskin92 deleted the braskin/fix_debug branch October 14, 2019 18:44
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.

2 participants