Package com.amazonaws.metrics
Class MetricAdmin
- java.lang.Object
-
- com.amazonaws.metrics.MetricAdmin
-
- All Implemented Interfaces:
MetricAdminMBean
public class MetricAdmin extends Object implements MetricAdminMBean
Administration of AwsSdkMetrics as an MBean.
-
-
Constructor Summary
Constructors Constructor Description MetricAdmin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableMetrics()Disables the metric collector at the AWS SDK level.booleanenableDefaultMetrics()Starts the default AWS SDK metric collector, but only if no metric collector is currently in use at the AWS SDK level.StringgetCredentialFile()Returns the last set AWS credential file; or null if there is none.StringgetHostMetricName()Returns the host name for metric purposes.StringgetJvmMetricName()Returns the JVM metric name.StringgetMetricNameSpace()Returns the metric name space.IntegergetMetricQueueSize()Returns the internal metric queue size to be used for the default AWS SDK metric collector; or null if the default is to be used.IntegergetQueuePollTimeoutMilli()Returns the internal metric queue timeout in millisecond to be used for the default AWS SDK metric collector; or null if the default is to be used.StringgetRegion()Returns the region configured for the default AWS SDK metric collector; or null if the default is to be used.StringgetRequestMetricCollector()Returns the name of the request metric collector set at the AWS SDK level, or NONE if there is none.StringgetServiceMetricCollector()Returns the name of the service metric collector set at the AWS SDK level, or NONE if there is none.booleanisMachineMetricsExcluded()Returns true if machine metrics is to be excluded; false otherwise.booleanisMetricsEnabled()Returns true if metrics at the AWS SDK level is enabled; false if disabled.booleanisPerHostMetricsIncluded()Returns true if per-host metrics is to be included; false otherwise.booleanisSingleMetricNamespace()Returns true if single metric name space is to be used; false otherwise.voidsetCredentialFile(String filepath)Sets the AWS credential file used by the default AWS SDK metric collector for accessing CloudWatch.voidsetHostMetricName(String hostMetricName)Sets the host name to enable per-host level metrics generation.voidsetJvmMetricName(String jvmMetricName)Sets the JVM metric name to enable per-JVM level metrics generation.voidsetMachineMetricsExcluded(boolean excludeJvmMetrics)Used to set whether the JVM metrics is to be excluded.voidsetMetricNameSpace(String metricNameSpace)Sets the metric name space.voidsetMetricQueueSize(Integer metricQueueSize)Sets the metric queue size to be used for the default AWS SDK metric collector; or null if the default is to be used.voidsetPerHostMetricsIncluded(boolean includePerHostMetrics)Used to set whether the per-host metrics is to be included.voidsetQueuePollTimeoutMilli(Integer timeoutMilli)Sets the queue poll time in millisecond to be used for the default AWS SDK metric collector; or null if the default is to be used.voidsetRegion(String region)Sets the region to be used for the default AWS SDK metric collector; or null if the default is to be used.voidsetSingleMetricNamespace(boolean singleMetricNamespace)Used to set whether a single metric name space is to be used.
-
-
-
Method Detail
-
enableDefaultMetrics
public boolean enableDefaultMetrics()
Description copied from interface:MetricAdminMBeanStarts the default AWS SDK metric collector, but only if no metric collector is currently in use at the AWS SDK level.- Specified by:
enableDefaultMetricsin interfaceMetricAdminMBean- Returns:
- true if the default AWS SDK metric collector has been successfully started by this call; false otherwise.
-
disableMetrics
public void disableMetrics()
Description copied from interface:MetricAdminMBeanDisables the metric collector at the AWS SDK level.- Specified by:
disableMetricsin interfaceMetricAdminMBean
-
getRequestMetricCollector
public String getRequestMetricCollector()
Description copied from interface:MetricAdminMBeanReturns the name of the request metric collector set at the AWS SDK level, or NONE if there is none.- Specified by:
getRequestMetricCollectorin interfaceMetricAdminMBean
-
getServiceMetricCollector
public String getServiceMetricCollector()
Description copied from interface:MetricAdminMBeanReturns the name of the service metric collector set at the AWS SDK level, or NONE if there is none.- Specified by:
getServiceMetricCollectorin interfaceMetricAdminMBean
-
isMetricsEnabled
public boolean isMetricsEnabled()
Description copied from interface:MetricAdminMBeanReturns true if metrics at the AWS SDK level is enabled; false if disabled.- Specified by:
isMetricsEnabledin interfaceMetricAdminMBean
-
isMachineMetricsExcluded
public boolean isMachineMetricsExcluded()
Description copied from interface:MetricAdminMBeanReturns true if machine metrics is to be excluded; false otherwise.- Specified by:
isMachineMetricsExcludedin interfaceMetricAdminMBean
-
setMachineMetricsExcluded
public void setMachineMetricsExcluded(boolean excludeJvmMetrics)
Description copied from interface:MetricAdminMBeanUsed to set whether the JVM metrics is to be excluded.- Specified by:
setMachineMetricsExcludedin interfaceMetricAdminMBean- Parameters:
excludeJvmMetrics- true if JVM metrics is to be excluded; false otherwise.
-
getRegion
public String getRegion()
Description copied from interface:MetricAdminMBeanReturns the region configured for the default AWS SDK metric collector; or null if the default is to be used.- Specified by:
getRegionin interfaceMetricAdminMBean
-
setRegion
public void setRegion(String region)
Description copied from interface:MetricAdminMBeanSets the region to be used for the default AWS SDK metric collector; or null if the default is to be used.- Specified by:
setRegionin interfaceMetricAdminMBean
-
getMetricQueueSize
public Integer getMetricQueueSize()
Description copied from interface:MetricAdminMBeanReturns the internal metric queue size to be used for the default AWS SDK metric collector; or null if the default is to be used.- Specified by:
getMetricQueueSizein interfaceMetricAdminMBean
-
setMetricQueueSize
public void setMetricQueueSize(Integer metricQueueSize)
Description copied from interface:MetricAdminMBeanSets the metric queue size to be used for the default AWS SDK metric collector; or null if the default is to be used.- Specified by:
setMetricQueueSizein interfaceMetricAdminMBean
-
getQueuePollTimeoutMilli
public Integer getQueuePollTimeoutMilli()
Description copied from interface:MetricAdminMBeanReturns the internal metric queue timeout in millisecond to be used for the default AWS SDK metric collector; or null if the default is to be used. Use Integer instead of Long as it seems jconsole does not handle Long properly.- Specified by:
getQueuePollTimeoutMilliin interfaceMetricAdminMBean
-
setQueuePollTimeoutMilli
public void setQueuePollTimeoutMilli(Integer timeoutMilli)
Description copied from interface:MetricAdminMBeanSets the queue poll time in millisecond to be used for the default AWS SDK metric collector; or null if the default is to be used. Use Integer instead of Long as it seems jconsole does not handle Long properly.- Specified by:
setQueuePollTimeoutMilliin interfaceMetricAdminMBean
-
getMetricNameSpace
public String getMetricNameSpace()
Description copied from interface:MetricAdminMBeanReturns the metric name space.- Specified by:
getMetricNameSpacein interfaceMetricAdminMBean
-
setMetricNameSpace
public void setMetricNameSpace(String metricNameSpace)
Description copied from interface:MetricAdminMBeanSets the metric name space.- Specified by:
setMetricNameSpacein interfaceMetricAdminMBean
-
isPerHostMetricsIncluded
public boolean isPerHostMetricsIncluded()
Description copied from interface:MetricAdminMBeanReturns true if per-host metrics is to be included; false otherwise.- Specified by:
isPerHostMetricsIncludedin interfaceMetricAdminMBean
-
setPerHostMetricsIncluded
public void setPerHostMetricsIncluded(boolean includePerHostMetrics)
Description copied from interface:MetricAdminMBeanUsed to set whether the per-host metrics is to be included.- Specified by:
setPerHostMetricsIncludedin interfaceMetricAdminMBean- Parameters:
includePerHostMetrics- true if per-host metrics is to be included; false otherwise.
-
getJvmMetricName
public String getJvmMetricName()
Description copied from interface:MetricAdminMBeanReturns the JVM metric name. If the returned value is either null or blank, no JVM level metrics will be generated.- Specified by:
getJvmMetricNamein interfaceMetricAdminMBean
-
setJvmMetricName
public void setJvmMetricName(String jvmMetricName)
Description copied from interface:MetricAdminMBeanSets the JVM metric name to enable per-JVM level metrics generation. If the given value is either null or blank, no JVM level metrics will be generated.- Specified by:
setJvmMetricNamein interfaceMetricAdminMBean
-
getHostMetricName
public String getHostMetricName()
Description copied from interface:MetricAdminMBeanReturns the host name for metric purposes. If the returned value is either null or blank, the host name will be automatically detected viaInetAddress.- Specified by:
getHostMetricNamein interfaceMetricAdminMBean
-
setHostMetricName
public void setHostMetricName(String hostMetricName)
Description copied from interface:MetricAdminMBeanSets the host name to enable per-host level metrics generation. If the given value is either null or blank but the per-host metric is enabled, the host name will be automatically detected viaInetAddress.- Specified by:
setHostMetricNamein interfaceMetricAdminMBean
-
getCredentialFile
public String getCredentialFile()
Description copied from interface:MetricAdminMBeanReturns the last set AWS credential file; or null if there is none.- Specified by:
getCredentialFilein interfaceMetricAdminMBean
-
setCredentialFile
public void setCredentialFile(String filepath) throws FileNotFoundException, IOException
Description copied from interface:MetricAdminMBeanSets the AWS credential file used by the default AWS SDK metric collector for accessing CloudWatch.- Specified by:
setCredentialFilein interfaceMetricAdminMBean- Parameters:
filepath- must be a valid path to an AWS credential property file.- Throws:
FileNotFoundExceptionIOException
-
isSingleMetricNamespace
public boolean isSingleMetricNamespace()
Description copied from interface:MetricAdminMBeanReturns true if single metric name space is to be used; false otherwise.- Specified by:
isSingleMetricNamespacein interfaceMetricAdminMBean
-
setSingleMetricNamespace
public void setSingleMetricNamespace(boolean singleMetricNamespace)
Description copied from interface:MetricAdminMBeanUsed to set whether a single metric name space is to be used.- Specified by:
setSingleMetricNamespacein interfaceMetricAdminMBean
-
-