From 7b4125f23cb847b53f6cacbe67050a16c688c6a4 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Thu, 14 May 2020 11:23:12 -0700 Subject: [Metrics] Add Rtt measurement duration metrics Updated-PDD: TRUE Bug: 131708995 Test: atest com.android.server.wifi Change-Id: Ib12fd6c730df726df7b3c80dd8f685df4e245922 --- .../com/android/server/wifi/rtt/RttMetrics.java | 35 ++++++++++++- .../android/server/wifi/rtt/RttServiceImpl.java | 5 +- service/proto/src/metrics.proto | 6 +++ .../android/server/wifi/rtt/RttMetricsTest.java | 60 ++++++++++++++-------- .../server/wifi/rtt/RttServiceImplTest.java | 45 ++++++++++------ 5 files changed, 111 insertions(+), 40 deletions(-) diff --git a/service/java/com/android/server/wifi/rtt/RttMetrics.java b/service/java/com/android/server/wifi/rtt/RttMetrics.java index da5cd9ee6..c2ee4ddb5 100644 --- a/service/java/com/android/server/wifi/rtt/RttMetrics.java +++ b/service/java/com/android/server/wifi/rtt/RttMetrics.java @@ -75,12 +75,21 @@ public class RttMetrics { // >= 100 private static final int[] DISTANCE_MM_HISTOGRAM = {0, 5 * 1000, 15 * 1000, 30 * 1000, 60 * 1000, 100 * 1000}; + // Histogram for duration for ap only measurement. Indicates 5 buckets with 1000 ms interval. + private static final int[] MEASUREMENT_DURATION_HISTOGRAM_AP = + {1 * 1000, 2 * 1000, 3 * 1000, 4 * 1000}; + + // Histogram for duration for measurement with aware. Indicates 5 buckets with 2000 ms interval. + private static final int[] MEASUREMENT_DURATION_HISTOGRAM_AWARE = + {2 * 1000, 4 * 1000, 6 * 1000, 8 * 1000}; private static final int PEER_AP = 0; private static final int PEER_AWARE = 1; private int mNumStartRangingCalls = 0; private SparseIntArray mOverallStatusHistogram = new SparseIntArray(); + private SparseIntArray mMeasurementDurationApOnlyHistogram = new SparseIntArray(); + private SparseIntArray mMeasurementDurationWithAwareHistogram = new SparseIntArray(); private PerPeerTypeInfo[] mPerPeerTypeInfo; public RttMetrics(Clock clock) { @@ -150,13 +159,14 @@ public class RttMetrics { /** * Record metrics for the range results. */ - public void recordResult(RangingRequest requests, List results) { + public void recordResult(RangingRequest requests, List results, + int measurementDuration) { Map requestEntries = new HashMap<>(); for (ResponderConfig responder : requests.mRttPeers) { requestEntries.put(responder.macAddress, responder); } - if (results != null) { + boolean containsAwarePeer = false; for (RangingResult result : results) { if (result == null) { continue; @@ -172,11 +182,21 @@ public class RttMetrics { if (responder.responderType == ResponderConfig.RESPONDER_AP) { updatePeerInfoWithResultInfo(mPerPeerTypeInfo[PEER_AP], result); } else if (responder.responderType == ResponderConfig.RESPONDER_AWARE) { + containsAwarePeer = true; updatePeerInfoWithResultInfo(mPerPeerTypeInfo[PEER_AWARE], result); } else { Log.e(TAG, "recordResult: unexpected peer type in responder: " + responder); } } + if (containsAwarePeer) { + addValueToLinearHistogram(measurementDuration, + mMeasurementDurationWithAwareHistogram, + MEASUREMENT_DURATION_HISTOGRAM_AWARE); + } else { + addValueToLinearHistogram(measurementDuration, + mMeasurementDurationApOnlyHistogram, + MEASUREMENT_DURATION_HISTOGRAM_AP); + } } for (ResponderConfig responder : requestEntries.values()) { @@ -255,6 +275,12 @@ public class RttMetrics { synchronized (mLock) { log.numRequests = mNumStartRangingCalls; log.histogramOverallStatus = consolidateOverallStatus(mOverallStatusHistogram); + log.histogramMeasurementDurationApOnly = genericBucketsToRttBuckets( + linearHistogramToGenericBuckets(mMeasurementDurationApOnlyHistogram, + MEASUREMENT_DURATION_HISTOGRAM_AP)); + log.histogramMeasurementDurationWithAware = genericBucketsToRttBuckets( + linearHistogramToGenericBuckets(mMeasurementDurationWithAwareHistogram, + MEASUREMENT_DURATION_HISTOGRAM_AWARE)); consolidatePeerType(log.rttToAp, mPerPeerTypeInfo[PEER_AP]); consolidatePeerType(log.rttToAware, mPerPeerTypeInfo[PEER_AWARE]); @@ -356,6 +382,9 @@ public class RttMetrics { pw.println("RTT Metrics:"); pw.println("mNumStartRangingCalls:" + mNumStartRangingCalls); pw.println("mOverallStatusHistogram:" + mOverallStatusHistogram); + pw.println("mMeasurementDurationApOnlyHistogram" + mMeasurementDurationApOnlyHistogram); + pw.println("mMeasurementDurationWithAwareHistogram" + + mMeasurementDurationWithAwareHistogram); pw.println("AP:" + mPerPeerTypeInfo[PEER_AP]); pw.println("AWARE:" + mPerPeerTypeInfo[PEER_AWARE]); } @@ -370,6 +399,8 @@ public class RttMetrics { mOverallStatusHistogram.clear(); mPerPeerTypeInfo[PEER_AP] = new PerPeerTypeInfo(); mPerPeerTypeInfo[PEER_AWARE] = new PerPeerTypeInfo(); + mMeasurementDurationApOnlyHistogram.clear(); + mMeasurementDurationWithAwareHistogram.clear(); } } diff --git a/service/java/com/android/server/wifi/rtt/RttServiceImpl.java b/service/java/com/android/server/wifi/rtt/RttServiceImpl.java index 02c262bba..ca986d112 100644 --- a/service/java/com/android/server/wifi/rtt/RttServiceImpl.java +++ b/service/java/com/android/server/wifi/rtt/RttServiceImpl.java @@ -92,6 +92,7 @@ public class RttServiceImpl extends IWifiRttManager.Stub { private ActivityManager mActivityManager; private PowerManager mPowerManager; private int mBackgroundProcessExecGapMs; + private long mLastRequestTimestamp; private RttServiceSynchronized mRttServiceSynchronized; @@ -829,6 +830,7 @@ public class RttServiceImpl extends IWifiRttManager.Stub { } nextRequest.cmdId = mNextCommandId++; + mLastRequestTimestamp = mClock.getWallClockMillis(); if (mRttNative.rangeRequest(nextRequest.cmdId, nextRequest.request, nextRequest.isCalledFromPrivilegedContext)) { long timeout = HAL_RANGING_TIMEOUT_MS; @@ -1065,7 +1067,8 @@ public class RttServiceImpl extends IWifiRttManager.Stub { List finalResults = postProcessResults(topOfQueueRequest.request, results, topOfQueueRequest.isCalledFromPrivilegedContext); mRttMetrics.recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); - mRttMetrics.recordResult(topOfQueueRequest.request, results); + mRttMetrics.recordResult(topOfQueueRequest.request, results, + (int) (mClock.getWallClockMillis() - mLastRequestTimestamp)); if (VDBG) { Log.v(TAG, "RttServiceSynchronized.onRangingResults: finalResults=" + finalResults); diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto index 688b45376..ad52af1f4 100644 --- a/service/proto/src/metrics.proto +++ b/service/proto/src/metrics.proto @@ -1918,6 +1918,12 @@ message WifiRttLog { // RTT to Wi-Fi Aware peers metrics optional RttToPeerLog rtt_to_aware = 4; + // Histogram of how long a measurement with only AP take. + repeated HistogramBucket histogram_measurement_duration_ap_only = 5; + + // Histogram of how long a measurement with aware peer included take. + repeated HistogramBucket histogram_measurement_duration_with_aware = 6; + // Metrics for a RTT to Peer (peer = AP or Wi-Fi Aware) message RttToPeerLog { // Total number of API calls diff --git a/tests/wifitests/src/com/android/server/wifi/rtt/RttMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/rtt/RttMetricsTest.java index a989f0903..937585610 100644 --- a/tests/wifitests/src/com/android/server/wifi/rtt/RttMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/rtt/RttMetricsTest.java @@ -77,7 +77,7 @@ public class RttMetricsTest extends WifiBaseTest { // no requests log = mDut.consolidateProto(); - checkMainStats("No requests", log, 0, 0); + checkMainStats("No requests", log, 0, 0, 0, 0); checkPeerStats("No requests: AP", log.rttToAp, 0, 0, 0, 0, 0, 0, 0, 0); checkPeerStats("No requests: Aware", log.rttToAware, 0, 0, 0, 0, 0, 0, 0, 0); @@ -110,7 +110,7 @@ public class RttMetricsTest extends WifiBaseTest { mDut.recordRequest(ws2, requestAp5); log = mDut.consolidateProto(); - checkMainStats("Sequence AP-only", log, 10, 0); + checkMainStats("Sequence AP-only", log, 10, 0, 0, 0); checkPeerStats("Sequence AP-only: AP", log.rttToAp, 10, 41, 2, 2, 4, 0, 0, 5); @@ -162,7 +162,7 @@ public class RttMetricsTest extends WifiBaseTest { mDut.recordRequest(ws3, requestMixed08); log = mDut.consolidateProto(); - checkMainStats("Sequence Mixed AP/Aware", log, 4, 0); + checkMainStats("Sequence Mixed AP/Aware", log, 4, 0, 0, 0); checkPeerStats("Sequence Mixed AP/Aware: AP", log.rttToAp, 2, 7, 3, 1, 2, 0, 0, 1); @@ -205,7 +205,7 @@ public class RttMetricsTest extends WifiBaseTest { // no requests log = mDut.consolidateProto(); - checkMainStats("No requests", log, 0, 0); + checkMainStats("No requests", log, 0, 0, 0, 0); checkPeerStats("No requests: AP", log.rttToAp, 0, 0, 0, 0, 0, 0, 0, 0); checkPeerStats("No requests: Aware", log.rttToAware, 0, 0, 0, 0, 0, 0, 0, 0); @@ -217,19 +217,23 @@ public class RttMetricsTest extends WifiBaseTest { mDut.clear(); mDut.recordResult(requestAp1, getDummyRangingResults(RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, - requestAp1, 5, 0)); + requestAp1, 5, 0), 500); mDut.recordResult(requestAp2, getDummyRangingResults(RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, - requestAp2, 10, 30)); + requestAp2, 10, 30), 1500); mDut.recordResult(requestAp5, getDummyRangingResults(RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, - requestAp5, 0.3, -0.2)); + requestAp5, 0.3, -0.2), 700); mDut.recordResult(requestAp6, getDummyRangingResults(RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, - requestAp6, 40, 30)); + requestAp6, 40, 30), 1800); log = mDut.consolidateProto(); - checkMainStats("Sequence AP-only", log, 0, 0); - + checkMainStats("Sequence AP-only", log, 0, 0, 2, 0); checkPeerStats("Sequence AP-only: AP", log.rttToAp, 0, 0, 0, 0, 0, 1, 6, 0); + validateProtoHistBucket("Sequence AP-only: histogramMeasurementDurationApOnly[0]", + log.histogramMeasurementDurationApOnly[0], Integer.MIN_VALUE, 1 * 1000, 2); + validateProtoHistBucket("Sequence AP-only: histogramMeasurementDurationApOnly[1]", + log.histogramMeasurementDurationApOnly[1], 1 * 1000, 2 * 1000, 2); + validateProtoIndividualStatusHistBucket( "Sequence AP-only: rttToAp.histogramIndividualStatus[0]", log.rttToAp.histogramIndividualStatus[0], WifiMetricsProto.WifiRttLog.SUCCESS, 14); @@ -257,19 +261,26 @@ public class RttMetricsTest extends WifiBaseTest { mDut.clear(); mDut.recordResult(requestMixed03, getDummyRangingResults( - RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed03, 5, 0)); + RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed03, 5, 0), 6400); mDut.recordResult(requestMixed25, getDummyRangingResults( - RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed25, 10, 30)); + RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed25, 10, 30), 7800); mDut.recordResult(requestMixed50, getDummyRangingResults( - RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed50, 0.3, -0.2)); + RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed50, 0.3, -0.2), 3100); mDut.recordResult(requestMixed08, getDummyRangingResults( - RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed08, 40, 30)); + RttNative.FRAMEWORK_RTT_STATUS_SUCCESS, requestMixed08, 40, 30), 9500); log = mDut.consolidateProto(); - checkMainStats("Sequence Mixed AP/Aware", log, 0, 0); + checkMainStats("Sequence Mixed AP/Aware", log, 0, 0, 1, 2); checkPeerStats("Sequence Mixed AP/Aware: AP", log.rttToAp, 0, 0, 0, 0, 0, 1, 4, 0); + validateProtoHistBucket("Sequence Mixed AP/Aware: histogramMeasurementDurationApOnly[0]", + log.histogramMeasurementDurationApOnly[0], 3 * 1000, 4 * 1000, 1); + validateProtoHistBucket("Sequence Mixed AP/Aware: histogramMeasurementDurationWithAware[0]", + log.histogramMeasurementDurationWithAware[0], 6 * 1000, 8 * 1000, 2); + validateProtoHistBucket("Sequence Mixed AP/Aware: histogramMeasurementDurationWithAware[1]", + log.histogramMeasurementDurationWithAware[1], 8 * 1000, Integer.MAX_VALUE, 1); + validateProtoIndividualStatusHistBucket( "Sequence Mixed AP/Aware: rttToAp.histogramIndividualStatus[0]", log.rttToAp.histogramIndividualStatus[0], WifiMetricsProto.WifiRttLog.SUCCESS, 7); @@ -315,11 +326,11 @@ public class RttMetricsTest extends WifiBaseTest { resultMixed25.remove(3); // Second Aware result: distance = 100 resultMixed25.remove(0); // First AP result: distance = 10 resultMixed25.add(null); - mDut.recordResult(requestMixed25, resultMixed25); + mDut.recordResult(requestMixed25, resultMixed25, 0); log = mDut.consolidateProto(); - checkMainStats("Sequence Mixed AP/Aware", log, 0, 0); + checkMainStats("Sequence Mixed AP/Aware", log, 0, 0, 0, 1); checkPeerStats("Sequence Mixed AP/Aware: AP", log.rttToAp, 0, 0, 0, 0, 0, 2, 1, 0); @@ -360,11 +371,11 @@ public class RttMetricsTest extends WifiBaseTest { mDut.clear(); RangingRequest requestMixed25 = getDummyRangingRequest(2, 5); - mDut.recordResult(requestMixed25, null); + mDut.recordResult(requestMixed25, null, 0); log = mDut.consolidateProto(); - checkMainStats("Sequence Mixed AP/Aware", log, 0, 0); + checkMainStats("Sequence Mixed AP/Aware", log, 0, 0, 0, 0); checkPeerStats("Sequence Mixed AP/Aware: AP", log.rttToAp, 0, 0, 0, 0, 0, 1, 0, 0); @@ -538,11 +549,18 @@ public class RttMetricsTest extends WifiBaseTest { } private void checkMainStats(String msgPrefix, WifiMetricsProto.WifiRttLog log, int numRequests, - int histogramOverallStatusLength) { + int histogramOverallStatusLength, int histogramMeasurementDurationApOnlyLength, + int histogramMeasurementDurationWithAwareLength) { collector.checkThat(msgPrefix + ": numRequests", log.numRequests, equalTo(numRequests)); collector.checkThat(msgPrefix + ": histogramOverallStatus.length", log.histogramOverallStatus.length, equalTo(histogramOverallStatusLength)); + collector.checkThat(msgPrefix + ": histogramMeasurementDurationApOnly.length", + log.histogramMeasurementDurationApOnly.length, + equalTo(histogramMeasurementDurationApOnlyLength)); + collector.checkThat(msgPrefix + ": histogramMeasurementDurationWithAware.length", + log.histogramMeasurementDurationWithAware.length, + equalTo(histogramMeasurementDurationWithAwareLength)); } private void checkPeerStats(String msgPrefix, WifiMetricsProto.WifiRttLog.RttToPeerLog log, @@ -605,7 +623,7 @@ public class RttMetricsTest extends WifiBaseTest { List results = getDummyRangingResults(status, request, 0, 0); for (int i = 0; i < n; ++i) { - mDut.recordResult(request, results); + mDut.recordResult(request, results, 0); } } diff --git a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java index 437f46a75..687c24f52 100644 --- a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java @@ -103,6 +103,7 @@ import java.util.Set; public class RttServiceImplTest extends WifiBaseTest { private static final int BACKGROUND_PROCESS_EXEC_GAP_MS = 10 * 60 * 1000; // 10 minutes. + private static final int MEASUREMENT_DURATION = 1000; private RttServiceImplSpy mDut; private TestLooper mMockLooper; @@ -265,6 +266,9 @@ public class RttServiceImplTest extends WifiBaseTest { results.add(RttTestUtils.getDummyRangingResults(requests[i])); } + ClockAnswer clock = new ClockAnswer(); + doAnswer(clock).when(mockClock).getWallClockMillis(); + clock.time = 100; // (1) request 10 ranging operations for (int i = 0; i < numIter; ++i) { mDut.startRanging(mockIbinder, mPackageName, mFeatureId, null, requests[i], @@ -273,6 +277,7 @@ public class RttServiceImplTest extends WifiBaseTest { mMockLooper.dispatchAll(); for (int i = 0; i < numIter; ++i) { + clock.time += MEASUREMENT_DURATION; // (2) verify that request issued to native verify(mockNative).rangeRequest(mIntCaptor.capture(), eq(requests[i]), eq(true)); verifyWakeupSet(i % 2 != 0, 0); @@ -293,7 +298,8 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics for (int i = 0; i < numIter; ++i) { verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(requests[i])); - verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second)); + verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second), + eq(MEASUREMENT_DURATION)); } verify(mockMetrics, times(numIter)).recordOverallStatus( WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); @@ -327,6 +333,9 @@ public class RttServiceImplTest extends WifiBaseTest { doAnswer(answer).when(mockAwareManager).requestMacAddresses(anyInt(), any(), any()); // issue request + ClockAnswer clock = new ClockAnswer(); + doAnswer(clock).when(mockClock).getWallClockMillis(); + clock.time = 100; mDut.startRanging(mockIbinder, mPackageName, mFeatureId, null, request, mockCallback); mMockLooper.dispatchAll(); @@ -351,6 +360,7 @@ public class RttServiceImplTest extends WifiBaseTest { results.second.add( new RangingResult(RangingResult.STATUS_FAIL, removed.getPeerHandle(), 0, 0, 0, 0, 0, null, null, null, 0)); + clock.time += MEASUREMENT_DURATION; mDut.onRangingResults(mIntCaptor.getValue(), results.first); mMockLooper.dispatchAll(); @@ -364,7 +374,8 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request)); - verify(mockMetrics).recordResult(eq(finalRequest), eq(results.first)); + verify(mockMetrics).recordResult(eq(finalRequest), eq(results.first), + eq(MEASUREMENT_DURATION)); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -426,7 +437,8 @@ public class RttServiceImplTest extends WifiBaseTest { for (int i = 0; i < numIter; ++i) { verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(requests[i])); if (i != 0) { - verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second)); + verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second), + anyInt()); } } verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_HAL_FAILURE); @@ -545,7 +557,8 @@ public class RttServiceImplTest extends WifiBaseTest { verify(mockMetrics).recordRequest(eq((i % 2) == 0 ? mDefaultWs : oddWs), eq(requests[i])); if (i % 2 == 1) { - verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second)); + verify(mockMetrics).recordResult(eq(requests[i]), eq(results.get(i).second), + anyInt()); } } verify(mockMetrics, times(numIter / 2)).recordOverallStatus( @@ -688,7 +701,7 @@ public class RttServiceImplTest extends WifiBaseTest { verifyWakeupCancelled(); // verify metrics - verify(mockMetrics).recordResult(eq(request), eq(results.second)); + verify(mockMetrics).recordResult(eq(request), eq(results.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -729,7 +742,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request)); - verify(mockMetrics).recordResult(eq(request), eq(results.second)); + verify(mockMetrics).recordResult(eq(request), eq(results.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -776,7 +789,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request)); - verify(mockMetrics).recordResult(eq(request), eq(results.second)); + verify(mockMetrics).recordResult(eq(request), eq(results.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -819,7 +832,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request)); - verify(mockMetrics).recordResult(eq(request), eq(new ArrayList<>())); + verify(mockMetrics).recordResult(eq(request), eq(new ArrayList<>()), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -872,7 +885,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request)); - verify(mockMetrics).recordResult(eq(request), eq(results.second)); + verify(mockMetrics).recordResult(eq(request), eq(results.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); verify(mockNative, atLeastOnce()).isReady(); @@ -925,7 +938,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request1)); verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request2)); - verify(mockMetrics).recordResult(eq(request2), eq(result2.second)); + verify(mockMetrics).recordResult(eq(request2), eq(result2.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_TIMEOUT); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); @@ -1035,9 +1048,9 @@ public class RttServiceImplTest extends WifiBaseTest { verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request3)); verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request4)); verify(mockMetrics).recordRequest(eq(mDefaultWs), eq(request5)); - verify(mockMetrics).recordResult(eq(request1), eq(result1.second)); - verify(mockMetrics).recordResult(eq(request3), eq(result3.second)); - verify(mockMetrics).recordResult(eq(request4), eq(result4.second)); + verify(mockMetrics).recordResult(eq(request1), eq(result1.second), anyInt()); + verify(mockMetrics).recordResult(eq(request3), eq(result3.second), anyInt()); + verify(mockMetrics).recordResult(eq(request4), eq(result4.second), anyInt()); verify(mockMetrics, times(2)).recordOverallStatus( WifiMetricsProto.WifiRttLog.OVERALL_THROTTLE); verify(mockMetrics, times(3)).recordOverallStatus( @@ -1137,8 +1150,8 @@ public class RttServiceImplTest extends WifiBaseTest { verify(mockMetrics).recordRequest(eq(wsReq1), eq(request1)); verify(mockMetrics).recordRequest(eq(wsReq2), eq(request2)); verify(mockMetrics).recordRequest(eq(wsReq1), eq(request3)); - verify(mockMetrics).recordResult(eq(request1), eq(result1.second)); - verify(mockMetrics).recordResult(eq(request2), eq(result2.second)); + verify(mockMetrics).recordResult(eq(request1), eq(result1.second), anyInt()); + verify(mockMetrics).recordResult(eq(request2), eq(result2.second), anyInt()); verify(mockMetrics).recordOverallStatus(WifiMetricsProto.WifiRttLog.OVERALL_THROTTLE); verify(mockMetrics, times(2)).recordOverallStatus( WifiMetricsProto.WifiRttLog.OVERALL_SUCCESS); @@ -1293,7 +1306,7 @@ public class RttServiceImplTest extends WifiBaseTest { // verify metrics verify(mockMetrics, times(RttServiceImpl.MAX_QUEUED_PER_UID + 12)).recordRequest( eq(useUids ? mDefaultWs : ws), eq(request)); - verify(mockMetrics).recordResult(eq(request), eq(result.second)); + verify(mockMetrics).recordResult(eq(request), eq(result.second), anyInt()); verify(mockMetrics, times(11)).recordOverallStatus( WifiMetricsProto.WifiRttLog.OVERALL_THROTTLE); verify(mockMetrics, times(RttServiceImpl.MAX_QUEUED_PER_UID)).recordOverallStatus( -- cgit v1.2.3