Updated Branches: refs/heads/master 42af9be0a -> 0f819bb6e
Added condition to avoid publishing statistics of lb clusters Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0f819bb6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0f819bb6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0f819bb6 Branch: refs/heads/master Commit: 0f819bb6e1eec56d0b39a4765fb9b455293b375e Parents: 42af9be Author: Imesh Gunaratne <[email protected]> Authored: Fri Dec 27 17:18:16 2013 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Fri Dec 27 17:18:16 2013 +0530 ---------------------------------------------------------------------- .../LoadBalancerStatisticsNotifier.java | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0f819bb6/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/notifier/LoadBalancerStatisticsNotifier.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/notifier/LoadBalancerStatisticsNotifier.java b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/notifier/LoadBalancerStatisticsNotifier.java index 88cfd4d..7268695 100644 --- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/notifier/LoadBalancerStatisticsNotifier.java +++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/notifier/LoadBalancerStatisticsNotifier.java @@ -48,7 +48,7 @@ public class LoadBalancerStatisticsNotifier implements Runnable { if (interval != null) { statsPublisherInterval = Long.getLong(interval); } - if(log.isDebugEnabled()) { + if (log.isDebugEnabled()) { log.debug(String.format("stats.notifier.interval: %dms", statsPublisherInterval)); } @@ -76,12 +76,19 @@ public class LoadBalancerStatisticsNotifier implements Runnable { int requestCount; for (Service service : TopologyManager.getTopology().getServices()) { for (Cluster cluster : service.getClusters()) { - // Publish in-flight request count of load balancer's network partition - requestCount = statsReader.getInFlightRequestCount(cluster.getClusterId()); - inFlightRequestPublisher.publish(cluster.getClusterId(), networkPartitionId, requestCount); - if (log.isDebugEnabled()) { - log.debug(String.format("In-flight request count published to cep: [cluster-id] %s [network-partition] %s [value] %d", - cluster.getClusterId(), networkPartitionId, requestCount)); + if (!cluster.isLbCluster()) { + // Publish in-flight request count of load balancer's network partition + requestCount = statsReader.getInFlightRequestCount(cluster.getClusterId()); + inFlightRequestPublisher.publish(cluster.getClusterId(), networkPartitionId, requestCount); + if (log.isDebugEnabled()) { + log.debug(String.format("In-flight request count published to cep: [cluster-id] %s [network-partition] %s [value] %d", + cluster.getClusterId(), networkPartitionId, requestCount)); + } + } + else { + if(log.isWarnEnabled()) { + log.warn(String.format("Load balancer cluster found in topology: %s", cluster.getClusterId())); + } } }
