Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
  *
  *  http://aws.amazon.com/apache2.0
  *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.s3.metrics;
S3 specific service metrics in the form of "simulated enum". The name of every enum literal defined in this class must all start with "S3" in order for the default AWS SDK metric collection system to recognize it as a predefined S3 metrics.
public class S3ServiceMetric extends SimpleMetricType implements ServiceMetricType {
    static final String SERVICE_NAME_PREFIX = "S3";

    
Returns a metric name by concatenating the service name prefix with the given suffix.
    private static final String metricName(String suffix) {
        return  + suffix;
    }
    public static final S3ThroughputMetric S3DownloadThroughput = new S3ThroughputMetric(
            metricName()) {
        @Override
        public ServiceMetricType getByteCountMetricType() {
            return ;
        }
    };
    public static final S3ServiceMetric S3DownloadByteCount = new S3ServiceMetric(
    public static final S3ThroughputMetric S3UploadThroughput = new S3ThroughputMetric(
            metricName()) {
        @Override
        public ServiceMetricType getByteCountMetricType() {
            return ;
        }
    };
    public static final S3ServiceMetric S3UploadByteCount = new S3ServiceMetric(
            metricName());
    private static final S3ServiceMetric[] values = {
        ,
        ,
        ,
        
    };
    private final String name;
    private S3ServiceMetric(String name) { this. = name; }
    @Override public String name() { return ; }
    @Override public String getServiceName() {
        return .;
    }
    private static abstract class S3ThroughputMetric extends S3ServiceMetric
            implements ThroughputMetricType {
        private S3ThroughputMetric(String name) {
            super(name);
        }
    };
    public static S3ServiceMetric[] values() { return .clone(); }
    public static S3ServiceMetric valueOf(String name) {
        for (S3ServiceMetric evalues()) {
            if (e.name().equals(name)) {
                return e;
            }
        }
        throw new IllegalArgumentException("No S3ServiceMetric defined for the name "name);
    }
New to GrepCode? Check out our FAQ X