mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7903: Decreased minimal usage aggregation range value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 9b907902d2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
This commit is contained in:
parent
7afd123418
commit
e124781445
|
|
@ -178,6 +178,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.GuestOSVO;
|
||||
|
|
@ -425,8 +426,7 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine.
|
|||
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;
|
||||
|
|
@ -808,9 +808,9 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine.
|
|||
_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()), (_usageAggregationRange * 60 * 1000),
|
||||
|
|
|
|||
|
|
@ -199,7 +199,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");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import org.apache.cloudstack.managed.context.ManagedContextRunnable;
|
|||
import org.apache.cloudstack.usage.UsageTypes;
|
||||
|
||||
import com.cloud.alert.AlertManager;
|
||||
import com.cloud.server.StatsCollector;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.event.UsageEventDetailsVO;
|
||||
import com.cloud.event.UsageEventVO;
|
||||
|
|
@ -100,7 +101,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 _accountDao;
|
||||
|
|
@ -246,9 +246,9 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
|||
s_logger.debug("Current Time: " + currentDate.toString());
|
||||
|
||||
_aggregationDuration = Integer.parseInt(aggregationRange);
|
||||
if (_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);
|
||||
_aggregationDuration = USAGE_AGGREGATION_RANGE_MIN;
|
||||
if (_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);
|
||||
_aggregationDuration = StatsCollector.USAGE_AGGREGATION_RANGE_MIN;
|
||||
}
|
||||
_hostname = InetAddress.getLocalHost().getHostName() + "/" + InetAddress.getLocalHost().getHostAddress();
|
||||
} catch (NumberFormatException ex) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue