class AllocationInfosDataSeries extends CaptureDataSeries<CaptureObject> {

  @Override
  public List<SeriesData<CaptureDurationData<CaptureObject>>> getDataForRange(Range range) {
    List<Memory.AllocationsInfo> infos =
      MemoryProfiler.getAllocationInfosForSession(myClient, mySession, range, myStage.getStudioProfilers().getIdeServices());

    List<SeriesData<CaptureDurationData<CaptureObject>>> seriesData = new ArrayList<>();
    for (Memory.AllocationsInfo info : infos) {
      long startTimeNs = info.getStartTime();
      long durationUs = getDurationUs(startTimeNs, info.getEndTime());

      seriesData.add(
        new SeriesData<>(
          getHostTime(startTimeNs),
          new CaptureDurationData<>(durationUs, !info.getLegacy(), !info.getLegacy(), new CaptureEntry<>(
            info,
            () -> {
              if (info.getLegacy()) {
                return new LegacyAllocationCaptureObject(myClient, mySession, info, myFeatureTracker);
              }
              else {
                return new LiveAllocationCaptureObject(myClient, mySession, startTimeNs, null, myStage);
              }
            }))));
    }
    return seriesData;
  }

  public  AllocationInfosDataSeries(@NotNull ProfilerClient client,
                                   @NotNull Common.Session session,
                                   @NotNull FeatureTracker featureTracker,
                                   @Nullable MemoryProfilerStage stage);

}