Merge "Add perf tests for binder calls to measure sampling performance."

This commit is contained in:
TreeHugger Robot
2018-07-31 10:49:37 +00:00
committed by Android (Google) Code Review

View File

@@ -68,6 +68,19 @@ public class BinderCallsStatsPerfTest {
}
}
@Test
public void timeCallSessionOnePercentSampling() {
mBinderCallsStats.setSamplingInterval(100);
final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
Binder b = new Binder();
int i = 0;
while (state.keepRunning()) {
CallSession s = mBinderCallsStats.callStarted(b, i % 100);
mBinderCallsStats.callEnded(s, 0, 0);
i++;
}
}
@Test
public void timeCallSessionTrackingDisabled() {
mBinderCallsStats.setDetailedTracking(false);