com.netflix.eureka.util
Class AwsAsgUtil

java.lang.Object
  extended by com.netflix.eureka.util.AwsAsgUtil

public class AwsAsgUtil
extends java.lang.Object

A utility class for querying and updating information about amazon autoscaling groups using the AWS APIs.


Method Summary
static AwsAsgUtil getInstance()
           
 long getNumberofASGQueries()
          Gets the number of ASG queries done in the period.
 long getNumberofASGQueryFailures()
          Gets the number of ASG queries that failed because of some reason.
 long getNumberofElementsinASGCache()
          Gets the number of elements in the ASG cache.
 boolean isASGEnabled(java.lang.String asgName)
          Return the status of the ASG whether is enabled or disabled for service.
 void setStatus(java.lang.String asgName, boolean enabled)
          Sets the status of the ASG
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AwsAsgUtil getInstance()

isASGEnabled

public boolean isASGEnabled(java.lang.String asgName)
Return the status of the ASG whether is enabled or disabled for service. The value is picked up from the cache except the very first time.

Parameters:
asgName - - The name of the ASG
Returns:
- true if enabled, false otherwise

setStatus

public void setStatus(java.lang.String asgName,
                      boolean enabled)
Sets the status of the ASG

Parameters:
asgName - - The name of the ASG
enabled - - true to enable, false to disable

getNumberofElementsinASGCache

@Monitor(name="numOfElementsinASGCache",
         description="Number of elements in the ASG Cache",
         type=GAUGE)
public long getNumberofElementsinASGCache()
Gets the number of elements in the ASG cache.

Returns:
the long value representing the number of elements in the ASG cache.

getNumberofASGQueries

@Monitor(name="numOfASGQueries",
         description="Number of queries made to AWS to retrieve ASG information",
         type=COUNTER)
public long getNumberofASGQueries()
Gets the number of ASG queries done in the period.

Returns:
the long value representing the number of ASG queries done in the period.

getNumberofASGQueryFailures

@Monitor(name="numOfASGQueryFailures",
         description="Number of queries made to AWS to retrieve ASG information and that failed",
         type=COUNTER)
public long getNumberofASGQueryFailures()
Gets the number of ASG queries that failed because of some reason.

Returns:
the long value representing the number of ASG queries that failed because of some reason.