| Index: components/cronet/android/api/src/org/chromium/net/UrlRequestMetrics.java
|
| diff --git a/components/cronet/android/api/src/org/chromium/net/UrlRequestMetrics.java b/components/cronet/android/api/src/org/chromium/net/UrlRequestMetrics.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1753bfaa700d2e7a839b64a9928e5ef3ab812353
|
| --- /dev/null
|
| +++ b/components/cronet/android/api/src/org/chromium/net/UrlRequestMetrics.java
|
| @@ -0,0 +1,65 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.net;
|
| +
|
| +import android.support.annotation.Nullable;
|
| +
|
| +/**
|
| + * Metrics collected for a single request.
|
| + *
|
| + * {@hide} as it's a prototype.
|
| + */
|
| +public final class UrlRequestMetrics {
|
| + @Nullable
|
| + private final Long mTtfbMs;
|
| + @Nullable
|
| + private final Long mTotalTimeMs;
|
| + @Nullable
|
| + private final Long mSentBytesCount;
|
| + @Nullable
|
| + private final Long mReceivedBytesCount;
|
| +
|
| + public UrlRequestMetrics(@Nullable Long ttfbMs, @Nullable Long totalTimeMs,
|
| + @Nullable Long sentBytesCount, @Nullable Long receivedBytesCount) {
|
| + mTtfbMs = ttfbMs;
|
| + mTotalTimeMs = totalTimeMs;
|
| + mSentBytesCount = sentBytesCount;
|
| + mReceivedBytesCount = receivedBytesCount;
|
| + }
|
| +
|
| + /**
|
| + * Returns milliseconds between request initiation and first byte of response headers,
|
| + * or null if not collected.
|
| + */
|
| + @Nullable
|
| + public Long getTtfbMs() {
|
| + return mTtfbMs;
|
| + }
|
| +
|
| + /**
|
| + * Returns milliseconds between request initiation and finish,
|
| + * including a failure or cancellation, or null if not collected.
|
| + */
|
| + @Nullable
|
| + public Long getTotalTimeMs() {
|
| + return mTotalTimeMs;
|
| + }
|
| +
|
| + /**
|
| + * Returns total bytes sent over the network transport layer, or null if not collected.
|
| + */
|
| + @Nullable
|
| + public Long getSentBytesCount() {
|
| + return mSentBytesCount;
|
| + }
|
| +
|
| + /**
|
| + * Returns total bytes received over the network transport layer, or null if not collected.
|
| + */
|
| + @Nullable
|
| + public Long getReceivedBytesCount() {
|
| + return mReceivedBytesCount;
|
| + }
|
| +}
|
|
|