You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/08/02 12:25:16 UTC

git commit: Fix error in lb agent component

Updated Branches:
  refs/heads/master 34e32bda4 -> 7b9fe6f5f


Fix error in lb agent component


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

Branch: refs/heads/master
Commit: 7b9fe6f5fe9d41c1d19ba679b59325c2fe9f7b87
Parents: 34e32bd
Author: Manula Thantriwatte <ma...@wso2.com>
Authored: Fri Aug 2 15:54:02 2013 +0530
Committer: Manula Thantriwatte <ma...@wso2.com>
Committed: Fri Aug 2 15:54:02 2013 +0530

----------------------------------------------------------------------
 .../lb/agent/LoadBalanceAgentService.java       | 55 ++++++++++++++++++++
 .../balance/agent/LoadBalanceAgentService.java  | 55 --------------------
 2 files changed, 55 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7b9fe6f5/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/lb/agent/LoadBalanceAgentService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/lb/agent/LoadBalanceAgentService.java b/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/lb/agent/LoadBalanceAgentService.java
new file mode 100644
index 0000000..e898112
--- /dev/null
+++ b/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/lb/agent/LoadBalanceAgentService.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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
+ *
+ * http://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.apache.stratos.lb.agent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.lang.management.ManagementFactory;
+
+/**
+ * Agent to get the system properties of the instances. Hence will be used in auto scaling, and
+ * also potentially in load balancing. Instances will be scaling up and down based on these params.
+ */
+public class LoadBalanceAgentService {
+
+    private static final Log log = LogFactory.getLog(LoadBalanceAgentService.class);
+
+
+    /**
+     * gets the load average of the system
+     *
+     * @return load average. Returns zero if the load average couldn't be read.
+     * Zero is treated as load-average not read, in the relevant places and ignored in the
+     * load balancer and autoscalar algorithms appropriately.
+     */
+    public double getLoadAverage() {
+        double systemLoadAverage = 0;
+        try {
+            systemLoadAverage =
+                    ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
+        } catch (Exception e) {
+            if (log.isDebugEnabled()) {
+                log.debug("Error in retrieving the load average of the instance");
+            }
+        }
+        return systemLoadAverage;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7b9fe6f5/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java b/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
deleted file mode 100644
index e898112..0000000
--- a/components/org.apache.stratos.lb.agent/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * http://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.apache.stratos.lb.agent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.lang.management.ManagementFactory;
-
-/**
- * Agent to get the system properties of the instances. Hence will be used in auto scaling, and
- * also potentially in load balancing. Instances will be scaling up and down based on these params.
- */
-public class LoadBalanceAgentService {
-
-    private static final Log log = LogFactory.getLog(LoadBalanceAgentService.class);
-
-
-    /**
-     * gets the load average of the system
-     *
-     * @return load average. Returns zero if the load average couldn't be read.
-     * Zero is treated as load-average not read, in the relevant places and ignored in the
-     * load balancer and autoscalar algorithms appropriately.
-     */
-    public double getLoadAverage() {
-        double systemLoadAverage = 0;
-        try {
-            systemLoadAverage =
-                    ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
-        } catch (Exception e) {
-            if (log.isDebugEnabled()) {
-                log.debug("Error in retrieving the load average of the instance");
-            }
-        }
-        return systemLoadAverage;
-    }
-}