CpuProfiler extends StudioProfiler { @Override public void startProfiling(Common.Session session) { myProfilers.getClient().getCpuClient().startMonitoringApp(CpuStartRequest.newBuilder().setSession(session).build()); } CpuProfiler(@NotNull StudioProfilers profilers); @Nullable File getTraceFile(Common.Session session); @Override ProfilerMonitor newMonitor(); @Override void startProfiling(Common.Session session); @Override void stopProfiling(Common.Session session); @NotNull static List<CpuTraceInfo> getTraceInfoFromRange(@NotNull ProfilerClient client,
                                                         @NotNull Common.Session session,
                                                         @NotNull Range rangeUs,
                                                         boolean newPipeline); @NotNull static CpuTraceInfo getTraceInfoFromId(@NotNull StudioProfilers profilers, long traceId); @NotNull static List<CpuTraceInfo> getTraceInfoFromSession(@NotNull ProfilerClient client,
                                                           @NotNull Common.Session session,
                                                           boolean newPipeline); @NotNull static Common.Event getTraceStatusEventFromId(@NotNull StudioProfilers profilers, long traceId); static void stopTracing(@NotNull StudioProfilers profilers,
                                 @NotNull Common.Session session,
                                 @NotNull Cpu.CpuTraceConfiguration configuration,
                                 @Nullable Consumer<Cpu.TraceStopStatus> responseHandler);  }
@Test public void startProfilingCallStartMonitoringAppId() { Assume.assumeFalse("Unified pipeline does not go through StartMonitoringApp", myUnifiedPipeline); myCpuProfiler = new CpuProfiler(myProfilers); myCpuProfiler.startProfiling(FAKE_SESSION); assertThat(myCpuService.getSession()).isEqualTo(FAKE_SESSION); }