Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java

Issue 2351793003: Implement timing metrics for UrlRequest (Closed)
Patch Set: Small cleanups Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net.impl; 5 package org.chromium.net.impl;
6 6
7 import android.support.annotation.Nullable; 7 import android.support.annotation.Nullable;
8 8
9 import org.chromium.base.VisibleForTesting; 9 import org.chromium.base.VisibleForTesting;
10 import org.chromium.net.RequestFinishedInfo; 10 import org.chromium.net.RequestFinishedInfo;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 long sendingEndMs, long pushStartMs, long pushEndMs, long responseSt artMs, 92 long sendingEndMs, long pushStartMs, long pushEndMs, long responseSt artMs,
93 long responseEndMs, boolean socketReused, long sentBytesCount, 93 long responseEndMs, boolean socketReused, long sentBytesCount,
94 long receivedBytesCount) { 94 long receivedBytesCount) {
95 // Check that no end times are before corresponding start times, 95 // Check that no end times are before corresponding start times,
96 // or exist when start time doesn't. 96 // or exist when start time doesn't.
97 assert checkOrder(dnsStartMs, dnsEndMs); 97 assert checkOrder(dnsStartMs, dnsEndMs);
98 assert checkOrder(connectStartMs, connectEndMs); 98 assert checkOrder(connectStartMs, connectEndMs);
99 assert checkOrder(sslStartMs, sslEndMs); 99 assert checkOrder(sslStartMs, sslEndMs);
100 assert checkOrder(sendingStartMs, sendingEndMs); 100 assert checkOrder(sendingStartMs, sendingEndMs);
101 assert checkOrder(pushStartMs, pushEndMs); 101 assert checkOrder(pushStartMs, pushEndMs);
102 assert checkOrder(responseStartMs, responseEndMs); 102 // responseEnd always exists, so just check that it's after start
103 assert responseEndMs >= responseStartMs;
103 // Spot-check some of the other orderings 104 // Spot-check some of the other orderings
104 assert dnsStartMs >= requestStartMs || dnsStartMs == -1; 105 assert dnsStartMs >= requestStartMs || dnsStartMs == -1;
105 assert sendingStartMs >= requestStartMs || sendingStartMs == -1; 106 assert sendingStartMs >= requestStartMs || sendingStartMs == -1;
106 assert sslStartMs >= connectStartMs || sslStartMs == -1; 107 assert sslStartMs >= connectStartMs || sslStartMs == -1;
107 assert responseStartMs >= sendingStartMs || responseStartMs == -1; 108 assert responseStartMs >= sendingStartMs || responseStartMs == -1;
108 mRequestStartMs = requestStartMs; 109 mRequestStartMs = requestStartMs;
109 mDnsStartMs = dnsStartMs; 110 mDnsStartMs = dnsStartMs;
110 mDnsEndMs = dnsEndMs; 111 mDnsEndMs = dnsEndMs;
111 mConnectStartMs = connectStartMs; 112 mConnectStartMs = connectStartMs;
112 mConnectEndMs = connectEndMs; 113 mConnectEndMs = connectEndMs;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 @Nullable 219 @Nullable
219 public Long getSentBytesCount() { 220 public Long getSentBytesCount() {
220 return mSentBytesCount; 221 return mSentBytesCount;
221 } 222 }
222 223
223 @Nullable 224 @Nullable
224 public Long getReceivedBytesCount() { 225 public Long getReceivedBytesCount() {
225 return mReceivedBytesCount; 226 return mReceivedBytesCount;
226 } 227 }
227 } 228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698