public ProjectCleaner purge(DbSession session, String rootUuid, String projectUuid, Configuration projectConfig, Set<String> disabledComponentUuids) {
    long start = System.currentTimeMillis();
    profiler.reset();

    periodCleaner.clean(session, rootUuid, projectConfig);

    PurgeConfiguration configuration = newDefaultPurgeConfiguration(projectConfig, rootUuid, projectUuid, disabledComponentUuids);
    purgeDao.purge(session, configuration, purgeListener, profiler);

    session.commit();
    logProfiling(start, projectConfig);
    return this;
  }
@Test
  public void profiling_when_property_is_true() {
    settings.setProperty(CoreProperties.PROFILING_LOG_PROPERTY, true);
    when(profiler.getProfilingResult(anyLong())).thenReturn(List.of(DUMMY_PROFILE_CONTENT));

    underTest.purge(mock(DbSession.class), "root", "project", settings.asConfig(), emptySet());

    verify(profiler).getProfilingResult(anyLong());
    assertThat(logTester.getLogs(Level.INFO).stream()
      .map(LogAndArguments::getFormattedMsg)
      .collect(Collectors.joining()))
      .contains("Profiling for purge")
      .contains(DUMMY_PROFILE_CONTENT);
  }