diff options
author | Dan Timoney <dtimoney@att.com> | 2019-11-18 13:42:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-11-18 13:42:03 +0000 |
commit | 14329e0da99ec17ba7dccb38159aa5223aca2f9b (patch) | |
tree | fca1592a3283b9efcd7049bb3424cc9b45adafa8 | |
parent | 1efc3aad5f102988243e7579adbf4890b8bf91a8 (diff) | |
parent | 6ee70eedd709d90ff0ddf7f12d45b03f1c8930b6 (diff) |
Merge "[CCSDK-1921]Connection Timeout and Info Logging"
-rwxr-xr-x | grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java b/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java index 119c0b9c..116afb3a 100755 --- a/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java +++ b/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java @@ -103,6 +103,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT private static final String FAULTY = "FAULTY"; private static final String VALUE = "value"; private static final String OUTPUT = "output"; + private static final int CONNECTION_TIMEOUT = 5000; // 5 second timeout private String akkaConfig; private String jolokiaClusterPath; private String shardManagerPath; @@ -256,7 +257,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT outputBuilder.setStatus("200"); outputBuilder.setHealth(getAdminHealth()); outputBuilder.setServedBy(member); - + log.info(outputBuilder.build().toString()); return Futures.immediateFuture(RpcResultBuilder.<AdminHealthOutput>status(true).withResult(outputBuilder.build()).build()); } @@ -484,6 +485,10 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT outputBuilder.setServedBy(member); RpcResult<ClusterHealthOutput> rpcResult = RpcResultBuilder.<ClusterHealthOutput>status(true).withResult(outputBuilder.build()).build(); + log.info("{}:cluster-health: Site 1 | Healthy ODLs {}", APP_NAME, site1Health); + if(siteConfiguration == SiteConfiguration.GEO) { + log.info("{}:cluster-health: Site 2 | Healthy ODLs {}", APP_NAME, site2Health); + } return Futures.immediateFuture(rpcResult); } @@ -557,6 +562,8 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT outputBuilder.getSites().add(builder.build()); builder = getSitesBuilder(site2HealthyODLs, site2Voting, crossSiteAdminHealthy, crossSiteDbHealthy, crossSiteIdentifier); outputBuilder.getSites().add(builder.build()); + log.info("{}:site-health: Site 1 ({}) | hasVotingMembers?: {} | Healthy ODLs: {} | ADM isHealthy?: {} | DB isHealthy?: {}", APP_NAME, siteIdentifier, site1Voting, site1HealthyODLs, HEALTHY.equals(adminHealth), HEALTHY.equals(databaseHealth)); + log.info("{}:site-health: Site 2 ({}) | hasVotingMembers?: {} | Healthy ODLs: {} | ADM isHealthy?: {} | DB isHealthy?: {}", APP_NAME, crossSiteIdentifier, site2Voting, site2HealthyODLs, crossSiteAdminHealthy, crossSiteDbHealthy); } else { // Make calls over to site 1 healthchecks @@ -595,6 +602,8 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT outputBuilder.getSites().add(builder.build()); builder = getSitesBuilder(site2HealthyODLs, site2Voting, HEALTHY.equals(adminHealth), HEALTHY.equals(databaseHealth), siteIdentifier); outputBuilder.getSites().add(builder.build()); + log.info("{}:site-health: Site 1 ({}) | hasVotingMembers?: {} | Healthy ODLs: {} | ADM isHealthy?: {} | DB isHealthy?: {}", APP_NAME, siteIdentifier, site1Voting, site1HealthyODLs, HEALTHY.equals(adminHealth), HEALTHY.equals(databaseHealth)); + log.info("{}:site-health: Site 2 ({}) | hasVotingMembers?: {} | Healthy ODLs: {} | ADM isHealthy?: {} | DB isHealthy?: {}", APP_NAME, crossSiteIdentifier, site2Voting, site2HealthyODLs, crossSiteAdminHealthy, crossSiteDbHealthy); } } @@ -931,6 +940,8 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT connection.addRequestProperty("Authorization", auth); connection.setRequestProperty("Connection", "keep-alive"); connection.setRequestProperty("Proxy-Connection", "keep-alive"); + connection.setConnectTimeout(CONNECTION_TIMEOUT); + connection.setReadTimeout(CONNECTION_TIMEOUT); return connection; } |