Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2010-2015, 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
 * or in the "license" file accompanying this file. This file is distributed
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
package com.amazonaws.metrics;

Byte throughput metric information provider.
public abstract class ByteThroughputProvider {
    private long duration;
    private int byteCount;
    private final ThroughputMetricType throughputType;
    protected ByteThroughputProvider(ThroughputMetricType type) { this. = type; }
    public int getByteCount() { return ; }
    public long getDurationNano() { return ; }
Returns a provider id that can be used to compute the number of active byte throughput provider of a specific metric type being active in a given time interval.
    public String getProviderId() { return super.toString(); }

bytesDelta the number of bytes to increment
startTimeNano the start time in nano seconds
    protected void increment(int bytesDeltalong startTimeNano) {
        this. += bytesDelta;
        this. += System.nanoTime() - startTimeNano;
    protected void reset() {
        this. = 0;
        this. = 0;
    public String toString() {
        return String.format(
                "providerId=%s, throughputType=%s, byteCount=%d, duration=%d",
                getProviderId(), );
New to GrepCode? Check out our FAQ X