CS-15729:AutoScale. Aligning the NetScaler response time counter, and correcting duration check against interval

This commit is contained in:
Vijay Venkatachalam 2012-09-12 21:40:39 +05:30
parent acb963f1ee
commit 58db4d0d88
2 changed files with 6 additions and 13 deletions

View File

@ -223,10 +223,6 @@ public class AutoScaleManagerImpl<Type> implements AutoScaleService, Manager {
throw new InvalidParameterValueException("duration : " + duration + " specified in a policy cannot be less than vm group's interval : " + interval);
}
if (quietTime < interval) {
throw new InvalidParameterValueException("quietTime : " + quietTime + " specified in a policy cannot be less than vm group's interval : " + interval);
}
if (quietTime != prevQuietTime) {
throw new InvalidParameterValueException("quietTime should be same for all the policies specified in " + paramName);
}
@ -669,12 +665,9 @@ public class AutoScaleManagerImpl<Type> implements AutoScaleService, Manager {
if (!vmGroupVO.getState().equals(AutoScaleVmGroup.State_Disabled)) {
throw new InvalidParameterValueException("The AutoScale Policy can be updated only if the Vm Group it is associated with is disabled in state");
}
if (vmGroupVO.getInterval() < policy.getDuration()) {
if (policy.getDuration() < vmGroupVO.getInterval()) {
throw new InvalidParameterValueException("duration is less than the associated AutoScaleVmGroup's interval");
}
if (vmGroupVO.getInterval() < policy.getQuietTime()) {
throw new InvalidParameterValueException("quietTime is less than the associated AutoScaleVmGroup's interval");
}
}
policy = checkValidityAndPersist(policy, conditionIds);

View File

@ -2482,7 +2482,7 @@ CREATE TABLE `cloud`.`autoscale_vmgroups` (
CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`) REFERENCES `data_center`(`id`),
CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`),
INDEX `i_autoscale_vmgroups__removed`(`removed`),
INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`)
INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`autoscale_policy_condition_map` (
@ -2505,9 +2505,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` (
INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU Time(%)', '.1.3.6.1.4.1.2021.11.9.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU Time(%)', '.1.3.6.1.4.1.2021.11.10.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle Time(%)', '.1.3.6.1.4.1.2021.11.11.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (100,'netscaler','ResponseTime(in ms)', 'RESPTIME', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (100,'netscaler','Response Time - microseconds)', 'RESPTIME', now());
SET foreign_key_checks = 1;