Exemplo n.º 1
0
 def __init__(self):
     self.last_scale_up = {}
     self.last_scale_down = {}
     self.scheduler = sched.scheduler(self._now, time.sleep)
     self.schedule_interval_seconds = config['GENERAL']['SCHEDULE_INTERVAL_SECONDS']
     self.cooldown_seconds_after_scale_up = config['GENERAL']['COOLDOWN_SECONDS_AFTER_SCALE_UP']
     self.cooldown_seconds_after_scale_down = config['GENERAL']['COOLDOWN_SECONDS_AFTER_SCALE_DOWN']
     self.statsd_client = get_statsd_client()
     self.paas_client = PaasClient()
     self._load_autoscaler_apps()
Exemplo n.º 2
0
 def __init__(self):
     self.last_scale_up = {}
     self.last_scale_down = {}
     self.scheduler = sched.scheduler(self._now, time.sleep)
     self.schedule_interval_seconds = config['GENERAL'][
         'SCHEDULE_INTERVAL_SECONDS']
     self.cooldown_seconds_after_scale_up = config['GENERAL'][
         'COOLDOWN_SECONDS_AFTER_SCALE_UP']
     self.cooldown_seconds_after_scale_down = config['GENERAL'][
         'COOLDOWN_SECONDS_AFTER_SCALE_DOWN']
     self.statsd_client = get_statsd_client()
     self.paas_client = PaasClient()
     self.redis_client = Redis.from_url(
         os.environ.get('REDIS_URL', 'redis://redis.local'))
     self._load_autoscaler_apps()
 def __init__(self, min_instances, max_instances, threshold, **kwargs):
     self.min_instances = min_instances
     self.max_instances = max_instances
     self.threshold = threshold
     self.app_name = kwargs.get('app_name', 'missing_name')
     self.statsd_client = get_statsd_client()
Exemplo n.º 4
0
 def __init__(self, app_name, min_instances, max_instances):
     self.app_name = app_name
     self.min_instances = min_instances
     self.max_instances = max_instances
     self.statsd_client = get_statsd_client()