Package com.netflix.eureka.aws
Class AwsAsgUtil
- java.lang.Object
-
- com.netflix.eureka.aws.AwsAsgUtil
-
-
Constructor Summary
Constructors Constructor Description AwsAsgUtil(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, InstanceRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNumberofASGQueries()Gets the number of ASG queries done in the period.longgetNumberofASGQueryFailures()Gets the number of ASG queries that failed because of some reason.longgetNumberofElementsinASGCache()Gets the number of elements in the ASG cache.booleanisASGEnabled(com.netflix.appinfo.InstanceInfo instanceInfo)Return the status of the ASG whether is enabled or disabled for service.voidsetStatus(java.lang.String asgName, boolean enabled)Sets the status of the ASG.
-
-
-
Constructor Detail
-
AwsAsgUtil
@Inject public AwsAsgUtil(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, InstanceRegistry registry)
-
-
Method Detail
-
isASGEnabled
public boolean isASGEnabled(com.netflix.appinfo.InstanceInfo instanceInfo)
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.- Specified by:
isASGEnabledin interfaceAsgClient- Parameters:
instanceInfo- the instanceInfo for the lookup- Returns:
- true if enabled, false otherwise
-
setStatus
public void setStatus(java.lang.String asgName, boolean enabled)Sets the status of the ASG.
-
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.
-
-