zhengyangyong commented on a change in pull request #555: [SCB-327] Update
metrics publish data module (Re-organized)
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/555#discussion_r170415566
##########
File path:
metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/publish/HealthCheckerPublisher.java
##########
@@ -60,16 +53,19 @@ private void init(HealthCheckerManager manager) {
@RequestMapping(path = "/", method = RequestMethod.GET)
@CrossOrigin
- public Map<String, HealthCheckResult> health() {
- return manager.check();
+ public boolean checkHealth() {
+ Map<String, HealthCheckResult> results = manager.check();
+ for (HealthCheckResult result : results.values()) {
+ if (!result.isHealthy()) {
+ return false;
+ }
+ }
+ return true;
}
- @ApiResponses({
- @ApiResponse(code = 400, response = String.class, message = "illegal
request content"),
- })
- @RequestMapping(path = "/{name}", method = RequestMethod.GET)
+ @RequestMapping(path = "/detail", method = RequestMethod.GET)
@CrossOrigin
- public HealthCheckResult healthWithName(@PathVariable(name = "name") String
name) {
- return manager.check(name);
+ public Map<String, HealthCheckResult> checkHealthDetail() {
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services