-
Notifications
You must be signed in to change notification settings - Fork 715
Lb micrometer stats #871
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
Merged
Merged
Lb micrometer stats #871
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8ebe1fb
Add stats lifecycle bean. Add onStartRequest method to LoadBalancerLi…
OlgaMaciaszek e63caac
Add TimedRequestContext interface. Make RetryableRequestContext exten…
OlgaMaciaszek cfdc347
Add separate meters depending on CompletionContext.Status.
OlgaMaciaszek 101db04
Modify registered metrics. Add adapter for BlockingLoadBalancerClient…
OlgaMaciaszek 3c6d30c
Make new config conditional on MeterRegistry class.
OlgaMaciaszek 28ad929
Rename lifecycle bean. Do not log request if 0 timestamp.
OlgaMaciaszek 05edd79
Fix onStartRequest call arguments for BlockingLoadBalancerClient.
OlgaMaciaszek 3f20e7e
Fix onStartRequest and onComplete calls for RetryLoadBalancerIntercep…
OlgaMaciaszek 3cc7b8a
Only register timed request once. Add tests.
OlgaMaciaszek 9b1ff91
Adjust tags logic. Add more tests.
OlgaMaciaszek 9318a06
Add more tests.
OlgaMaciaszek b089d9f
Refactor. Add javadocs.
OlgaMaciaszek b73341d
Refactor.
OlgaMaciaszek af8d2c6
Refactor.
OlgaMaciaszek 8fba4d4
Retrieve client response data if possible in BlockingLoadBalancerClient.
OlgaMaciaszek 0960c6a
Refactor.
OlgaMaciaszek 6df4398
Fix docs after review.
OlgaMaciaszek d89252b
Make previousServiceInstanceMutable.
OlgaMaciaszek 5d1ec8c
Change argument order for CompletionContext constructors. Remove dupl…
OlgaMaciaszek 80da0a8
Merge remote-tracking branch 'origin/master' into lb-micrometer-stats
OlgaMaciaszek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
...c/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRequestAdapter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2012-2020 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.cloud.client.loadbalancer; | ||
|
||
import org.springframework.cloud.client.ServiceInstance; | ||
|
||
/** | ||
* An adapter class that allows creating {@link Request} objects from previously | ||
* {@link LoadBalancerRequest} objects. | ||
* | ||
* @author Olga Maciaszek-Sharma | ||
* @since 3.0.0 | ||
*/ | ||
public class LoadBalancerRequestAdapter<T, RC> extends DefaultRequest<RC> implements LoadBalancerRequest<T> { | ||
|
||
private final LoadBalancerRequest<T> delegate; | ||
|
||
public LoadBalancerRequestAdapter(LoadBalancerRequest<T> delegate) { | ||
this.delegate = delegate; | ||
} | ||
|
||
public LoadBalancerRequestAdapter(LoadBalancerRequest<T> delegate, RC context) { | ||
super(context); | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public T apply(ServiceInstance instance) throws Exception { | ||
return delegate.apply(instance); | ||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.