class CpuProfiler extends StudioProfiler {

  @Override
  public void stopProfiling(Common.Session session) {
    List<CpuTraceInfo> traces =
      getTraceInfoFromSession(myProfilers.getClient(), session, myProfilers.getIdeServices().getFeatureConfig().isUnifiedPipelineEnabled());
    CpuTraceInfo mostRecentTrace = traces.isEmpty() ? null : traces.get(traces.size() - 1);
    if (mostRecentTrace != null && mostRecentTrace.getToTimestamp() == -1) {
      stopTracing(myProfilers,
                  session,
                  mostRecentTrace.getConfiguration(),
                  null);
    }

    // TODO: handle different status of the response
    myProfilers.getClient().getCpuClient().stopMonitoringApp(CpuStopRequest.newBuilder().setSession(session).build());
  }

  public  CpuProfiler(@NotNull StudioProfilers profilers);

}