// For now it is bound globally.
// bind timer trigger lb_astimer -policyName lb_policy_scaleUp -vserver lb -priority 1 -samplesize 5
// TODO: later bind to lbvserver. bind timer trigger lb_astimer -policyName lb_policy_scaleUp -vserver lb
// -priority 1 -samplesize 5
// -thresholdsize 5
nstimer_autoscalepolicy_binding timer_policy_binding = new nstimer_autoscalepolicy_binding();
int sampleSize = duration / interval;
try {
timer_policy_binding.set_name(timerName);
timer_policy_binding.set_policyname(policyName);
timer_policy_binding.set_samplesize(sampleSize);
timer_policy_binding.set_threshold(sampleSize); // We are not exposing this parameter as of now.
// i.e. n(m) is not exposed to CS user. So thresholdSize == sampleSize
timer_policy_binding.set_priority(priority);
nstimer_autoscalepolicy_binding.add(_netscalerService, timer_policy_binding);
} catch (Exception e) {
// Ignore Exception on cleanup
if (!isCleanUp)
throw e;