JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.795

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws.metrics.internal.cloudwatch

Class CloudWatchMetricConfig



  • @NotThreadSafe
    public class CloudWatchMetricConfig
    extends Object 
    Configuration for the default AWS SDK collection implementation. This class is not intended to be used directly by client code except for cases where the default behavior of the internal Amazon CloudWatch collector implementation needs to be customized.

    Example:

     /**
     * My custom Request Metric Collector by extending from the internal Amazon CloudWatch
     * implementation.
     */
     static class MyCloudWatchMetricCollector extends
     CloudWatchRequestMetricCollector {
     MyCloudWatchMetricCollector(CloudWatchMetricConfig config) {
     super(config);
     }
     }
     MyCloudWatchMetricCollector myCollector = new MyCloudWatchMetricCollector(
     new CloudWatchMetricConfig()
     .withQueuePollTimeoutMilli(60000)
     .withMetricQueueSize(1000)
     .withCredentialsProvider(
     new DefaultAWSCredentialsProviderChain())
     .withEndpointConfiguration(new EndpointConfiguration("https://monitoring.us-west-2.amazonaws.com", "us-west-2"))
     .withPredefinedMetrics(
     new HashSet<Field>(Arrays.asList(Field.HttpRequestTime,
     Field.ResponseProcessingTime)));
     myCollector.start();
     // Enable the AWS SDK level request metric collection with a custom collector
     AwsSdkMetrics.setRequestMetricCollector(myCollector);
     
    See Also:
    AwsSdkMetrics
    • Field Detail

      • DEFAULT_METRICS_QSIZE

        public static final int DEFAULT_METRICS_QSIZE
        Default metrics queue size. If the queue size exceeds this value, then excessive metrics will be dropped to prevent resource exhaustion.
        See Also:
        Constant Field Values
      • DEFAULT_QUEUE_POLL_TIMEOUT_MILLI

        public static final int DEFAULT_QUEUE_POLL_TIMEOUT_MILLI
        Default timeout in millisecond for queue polling. Set to one-minute which is the finest granularity of Amazon CloudWatch.
    • Constructor Detail

      • CloudWatchMetricConfig

        public CloudWatchMetricConfig()
    • Method Detail

      • getCredentialsProvider

        public AWSCredentialsProvider getCredentialsProvider()
        Returns the credential provider that holds the credentials to connect to Amazon CloudWatch.
      • setCredentialsProvider

        public void setCredentialsProvider(AWSCredentialsProvider credentialsProvider)
        Sets the credential provider to the given provider. This credential provider is used by the uploader thread to connect to Amazon CloudWatch.
      • getClientConfiguration

        public ClientConfiguration getClientConfiguration()
        Returns the Client Configuration used to connect to Amazon CloudWatch.
      • setClientConfiguration

        public void setClientConfiguration(ClientConfiguration clientConfiguration)
        Sets the Client Configuration. This client configuration is used by the uploader thread to connect to Amazon CloudWatch.
      • getQueuePollTimeoutMilli

        public long getQueuePollTimeoutMilli()
        Returns the metrics queue polling timeout in millisecond.
      • setQueuePollTimeoutMilli

        public void setQueuePollTimeoutMilli(long queuePollTimeoutMilli)
        Sets the metric queue polling timeout in millisecond. The default set set to one-minute per the finest granularity of Amazon CloudWatch
      • withQueuePollTimeoutMilli

        public CloudWatchMetricConfig withQueuePollTimeoutMilli(long queuePollTimeoutMilli)
      • getCloudWatchEndPoint

        public String getCloudWatchEndPoint()
        Returns the end point of AmazonCloudWatch to upload the metrics.
      • setCloudWatchEndPoint

        @Deprecated
        public void setCloudWatchEndPoint(String cloudWatchEndPoint)
        Deprecated. Use #setEndpointConfiguration(EndpointConfiguration) instead
        Sets the end point of AmazonCloudWatch to upload the metrics.
      • withCloudWatchEndPoint

        @Deprecated
        public CloudWatchMetricConfig withCloudWatchEndPoint(String cloudWatchEndPoint)
        Deprecated. Use #withEndpointConfiguration(EndpointConfiguration) instead
        Sets the end point of AmazonCloudWatch to upload the metrics.
      • setEndpointConfiguration

        public void setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
        Configure the endpoint to be used
        Parameters:
        endpointConfiguration - the endpoint configuration
      • getMetricQueueSize

        public int getMetricQueueSize()
      • setMetricQueueSize

        public void setMetricQueueSize(int metricQueueSize)
        Configure the metric queue size, overriding the default. Must be at least 1.
        See Also:
        DEFAULT_METRICS_QSIZE
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /