cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.3 to 09ccf5a
Date Mon, 01 Dec 2014 10:29:56 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 0e0827f07 -> 09ccf5a64


CLOUDSTACK-7903: Decreased minimal usage aggregation range value

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 9b907902d2d424bc8b3136d97196457f42738fff)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	usage/src/com/cloud/usage/UsageManagerImpl.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/09ccf5a6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/09ccf5a6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/09ccf5a6

Branch: refs/heads/4.3
Commit: 09ccf5a64bf0f5e42ad0cbe8b4469d6b4ade5127
Parents: 0e0827f
Author: Ilia Shakitko <i.shakitko@tech.leaseweb.com>
Authored: Tue Nov 18 14:31:51 2014 +0100
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Dec 1 15:59:02 2014 +0530

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java        | 10 +++++-----
 server/src/com/cloud/server/StatsCollector.java           |  2 +-
 usage/src/com/cloud/usage/UsageManagerImpl.java           |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09ccf5a6/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index f3c6ffa..0974fdc 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -219,6 +219,7 @@ import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
 import com.cloud.resource.ResourceManager;
 import com.cloud.server.ConfigurationServer;
+import com.cloud.server.StatsCollector;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.VMTemplateVO;
@@ -416,8 +417,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements
V
     private int _usageAggregationRange = 1440;
     private String _usageTimeZone = "GMT";
     private final long mgmtSrvrId = MacAddress.getMacAddress().toLong();
-    private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 5;    // 5 seconds
-    private static final int USAGE_AGGREGATION_RANGE_MIN = 10; // 10 minutes, same as com.cloud.usage.UsageManagerImpl.USAGE_AGGREGATION_RANGE_MIN
+    private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 5; // 5 seconds
     private boolean _dailyOrHourly = false;
 
     ScheduledExecutorService _executor;
@@ -794,9 +794,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements
V
             _dailyOrHourly = false;
         }
 
-        if (_usageAggregationRange < USAGE_AGGREGATION_RANGE_MIN) {
-            s_logger.warn("Usage stats job aggregation range is to small, using the minimum
value of " + USAGE_AGGREGATION_RANGE_MIN);
-            _usageAggregationRange = USAGE_AGGREGATION_RANGE_MIN;
+        if (_usageAggregationRange < StatsCollector.USAGE_AGGREGATION_RANGE_MIN) {
+            s_logger.warn("Usage stats job aggregation range is to small, using the minimum
value of " + StatsCollector.USAGE_AGGREGATION_RANGE_MIN);
+            _usageAggregationRange = StatsCollector.USAGE_AGGREGATION_RANGE_MIN;
         }
 
         _networkStatsUpdateExecutor.scheduleAtFixedRate(new NetworkStatsUpdateTask(), (endDate
- System.currentTimeMillis()),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09ccf5a6/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 45fc43e..1d86930 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -138,7 +138,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
     private String _usageTimeZone = "GMT";
     private final long mgmtSrvrId = MacAddress.getMacAddress().toLong();
     private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 5;    // 5 seconds
-    private static final int USAGE_AGGREGATION_RANGE_MIN = 10; // 10 minutes, same to com.cloud.usage.UsageManagerImpl.USAGE_AGGREGATION_RANGE_MIN
+    public static final int USAGE_AGGREGATION_RANGE_MIN = 1;
     private boolean _dailyOrHourly = false;
 
 	//private final GlobalLock m_capacityCheckLock = GlobalLock.getInternLock("capacity.check");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09ccf5a6/usage/src/com/cloud/usage/UsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageManagerImpl.java b/usage/src/com/cloud/usage/UsageManagerImpl.java
index ce7594f..ba78ea4 100644
--- a/usage/src/com/cloud/usage/UsageManagerImpl.java
+++ b/usage/src/com/cloud/usage/UsageManagerImpl.java
@@ -44,6 +44,7 @@ import org.apache.cloudstack.usage.UsageTypes;
 import org.springframework.stereotype.Component;
 
 import com.cloud.alert.AlertManager;
+import com.cloud.server.StatsCollector;
 import com.cloud.event.EventTypes;
 import com.cloud.event.UsageEventVO;
 import com.cloud.event.dao.UsageEventDao;
@@ -101,7 +102,6 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager,
Runna
     private static final int HOURLY_TIME = 60;
     private static final int DAILY_TIME = 60 * 24;
     private static final int THREE_DAYS_IN_MINUTES = 60 * 24 * 3;
-    private static final int USAGE_AGGREGATION_RANGE_MIN = 10;
 
     @Inject private AccountDao m_accountDao;
     @Inject private UserStatisticsDao m_userStatsDao;
@@ -223,9 +223,9 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager,
Runna
             s_logger.debug("Current Time: "+currentDate.toString());
 
             m_aggregationDuration = Integer.parseInt(aggregationRange);
-            if (m_aggregationDuration < USAGE_AGGREGATION_RANGE_MIN) {
-                s_logger.warn("Usage stats job aggregation range is to small, using the minimum
value of " + USAGE_AGGREGATION_RANGE_MIN);
-                m_aggregationDuration = USAGE_AGGREGATION_RANGE_MIN;
+            if (m_aggregationDuration < StatsCollector.USAGE_AGGREGATION_RANGE_MIN) {
+                s_logger.warn("Usage stats job aggregation range is to small, using the minimum
value of " + StatsCollector.USAGE_AGGREGATION_RANGE_MIN);
+                m_aggregationDuration = StatsCollector.USAGE_AGGREGATION_RANGE_MIN;
             }
             m_hostname = InetAddress.getLocalHost().getHostName() + "/" + InetAddress.getLocalHost().getHostAddress();
         } catch (NumberFormatException ex) {


Mime
View raw message