Update LVS statistics reader

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0b2aed01
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0b2aed01
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0b2aed01

Branch: refs/heads/master
Commit: 0b2aed0138d4cb487d2ebe451f66670ae2812cd1
Parents: 849e17f
Author: Gayan Gunarathne <[email protected]>
Authored: Wed May 27 12:05:01 2015 +0530
Committer: Gayan Gunarathne <[email protected]>
Committed: Mon Jul 27 14:51:55 2015 +0530

----------------------------------------------------------------------
 extensions/load-balancer/lvs-extension/README.md      | 14 +-------------
 .../stratos/lvs/extension/LVSStatisticsReader.java    |  4 ++--
 2 files changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0b2aed01/extensions/load-balancer/lvs-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/README.md 
b/extensions/load-balancer/lvs-extension/README.md
index 3003aea..13de2e0 100644
--- a/extensions/load-balancer/lvs-extension/README.md
+++ b/extensions/load-balancer/lvs-extension/README.md
@@ -6,7 +6,7 @@ tenant application signups and domain mapping information 
received from Stratos
 
 ## How it works
 1. Wait for the complete topology event message to initialize the topology.
-2. Configure keepal
+2. Configure Keepalived
 3. Listen to topology, application, application signup, domain mapping events.
 4. Reload Keepalived instance with the new topology configuration.
 5. Periodically publish statistics to Complex Event Processor (CEP).
@@ -14,17 +14,5 @@ tenant application signups and domain mapping information 
received from Stratos
 ## Statistics publishing
 Set cep.stats.publisher.enabled to true in lvs-extension.sh file to enable 
statistics publishing.
 
-///Following need to removed
-Please note that
-Nginx must be compiled with HttpStubStatusModule module to read statistics. 
Execute the following command to make
- sure that HttpStubStatusModule module is installed:
-```
-nginx -V 2>&1 | grep -o with-http_stub_status_module
-```
-If HttpStubStatusModule is installed the following output will be given:
-```
-with-http_stub_status_module
-```
-
 ## Installation
 Please refer INSTALL.md for information on the installation process.

http://git-wip-us.apache.org/repos/asf/stratos/blob/0b2aed01/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
----------------------------------------------------------------------
diff --git 
a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
 
b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
index f707090..cfb3435 100644
--- 
a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
+++ 
b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
@@ -34,7 +34,7 @@ import java.io.IOException;
 public class LVSStatisticsReader implements LoadBalancerStatisticsReader {
 
        private static final Log log = 
LogFactory.getLog(LVSStatisticsReader.class);
-       private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -l 
--stats | grep TCP";
+       private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -L -n 
|grep Route"; //"ipvsadm -l --stats | grep TCP"
 
        private TopologyProvider topologyProvider;
 
@@ -55,7 +55,7 @@ public class LVSStatisticsReader implements 
LoadBalancerStatisticsReader {
                        if ((output != null) && (output.length() > 0)) {
                                array = output.split("\n");
                                for (int i = 0; i < array.length; i++) {
-                                       weight = 
Integer.parseInt(array[i].substring(38, 42).toString().trim());
+                                       weight = 
Integer.parseInt(array[i].substring(46, 50).toString().trim());
                                        totalWeight += weight;
                                }
                        }

Reply via email to