private void deleteAnalysisDuplications(List<List<String>> snapshotUuidsPartitions) { profiler.start("deleteAnalysisDuplications (duplications_index)"); snapshotUuidsPartitions.forEach(purgeMapper::deleteAnalysisDuplications); session.commit(); profiler.stop(); }
void deleteComponents(List<String> componentUuids) { if (componentUuids.isEmpty()) { return; } profiler.start("deleteComponents (projects)"); Lists.partition(componentUuids, MAX_RESOURCES_PER_QUERY).forEach(purgeMapper::deleteComponentsByUuids); session.commit(); profiler.stop(); }
void deleteComponentMeasures(List<String> componentUuids) { if (componentUuids.isEmpty()) { return; } profiler.start("deleteComponentMeasures (project_measures)"); Lists.partition(componentUuids, MAX_RESOURCES_PER_QUERY).forEach(purgeMapper::fullDeleteComponentMeasures); session.commit(); profiler.stop(); }
void deletePermissions(long rootId) { profiler.start("deletePermissions (group_roles)"); purgeMapper.deleteGroupRolesByComponentId(rootId); session.commit(); profiler.stop(); profiler.start("deletePermissions (user_roles)"); purgeMapper.deleteUserRolesByComponentId(rootId); session.commit(); profiler.stop(); }
void deleteProjectAlmBindings(String rootUuid) { profiler.start("deleteProjectAlmBindings (project_alm_bindings)"); purgeMapper.deleteProjectAlmBindingsByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteLinks(String rootUuid) { profiler.start("deleteLinks (project_links)"); purgeMapper.deleteProjectLinksByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteComponents(String rootUuid) { profiler.start("deleteComponents (projects)"); purgeMapper.deleteComponentsByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteProjectMappings(String rootUuid) { profiler.start("deleteProjectMappings (project_mappings)"); purgeMapper.deleteProjectMappingsByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteBranch(String rootUuid) { profiler.start("deleteBranch (project_branches)"); purgeMapper.deleteBranchByUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteIssues(String rootUuid) { profiler.start("deleteIssues (issue_changes)"); purgeMapper.deleteIssueChangesByProjectUuid(rootUuid); session.commit(); profiler.stop(); profiler.start("deleteIssues (issues)"); purgeMapper.deleteIssuesByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteFileSources(String rootUuid) { profiler.start("deleteFileSources (file_sources)"); purgeMapper.deleteFileSourcesByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteWebhooks(String rootUuid) { profiler.start("deleteWebhooks (webhooks)"); purgeMapper.deleteWebhooksByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteWebhookDeliveries(String rootUuid) { profiler.start("deleteWebhookDeliveries (webhook_deliveries)"); purgeMapper.deleteWebhookDeliveriesByProjectUuid(rootUuid); session.commit(); profiler.stop(); }
void deleteLiveMeasures(String rootUuid) { profiler.start("deleteLiveMeasures (live_measures)"); purgeMapper.deleteLiveMeasuresByProjectUuid(rootUuid); session.commit(); profiler.stop(); } }
void deleteByRootAndModulesOrSubviews(List<IdUuidPair> rootAndModulesOrSubviewsIds) { if (rootAndModulesOrSubviewsIds.isEmpty()) { return; } List<List<Long>> idPartitions = Lists.partition(IdUuidPairs.ids(rootAndModulesOrSubviewsIds), MAX_RESOURCES_PER_QUERY); List<List<String>> uuidsPartitions = Lists.partition(IdUuidPairs.uuids(rootAndModulesOrSubviewsIds), MAX_RESOURCES_PER_QUERY); profiler.start("deleteByRootAndModulesOrSubviews (properties)"); idPartitions.forEach(purgeMapper::deletePropertiesByComponentIds); session.commit(); profiler.stop(); profiler.start("deleteByRootAndModulesOrSubviews (manual_measures)"); uuidsPartitions.forEach(purgeMapper::deleteManualMeasuresByComponentUuids); session.commit(); profiler.stop(); }
void deleteComponentMeasures(List<String> analysisUuids, List<String> componentUuids) { if (analysisUuids.isEmpty() || componentUuids.isEmpty()) { return; } List<List<String>> analysisUuidsPartitions = Lists.partition(analysisUuids, MAX_SNAPSHOTS_PER_QUERY); List<List<String>> componentUuidsPartitions = Lists.partition(componentUuids, MAX_RESOURCES_PER_QUERY); profiler.start("deleteComponentMeasures"); for (List<String> analysisUuidsPartition : analysisUuidsPartitions) { for (List<String> componentUuidsPartition : componentUuidsPartitions) { purgeMapper.deleteComponentMeasures(analysisUuidsPartition, componentUuidsPartition); } } session.commit(); profiler.stop(); }
void purgeAnalyses(List<IdUuidPair> analysisUuids) { List<List<String>> analysisUuidsPartitions = Lists.partition(IdUuidPairs.uuids(analysisUuids), MAX_SNAPSHOTS_PER_QUERY); deleteAnalysisDuplications(analysisUuidsPartitions); profiler.start("deleteSnapshotWastedMeasures (project_measures)"); List<Long> metricIdsWithoutHistoricalData = purgeMapper.selectMetricIdsWithoutHistoricalData(); if (!metricIdsWithoutHistoricalData.isEmpty()) { analysisUuidsPartitions .forEach(analysisUuidsPartition -> purgeMapper.deleteAnalysisWastedMeasures(analysisUuidsPartition, metricIdsWithoutHistoricalData)); session.commit(); } profiler.stop(); profiler.start("updatePurgeStatusToOne (snapshots)"); analysisUuidsPartitions.forEach(purgeMapper::updatePurgeStatusToOne); session.commit(); profiler.stop(); }
void deleteCeQueue(String rootUuid) { profiler.start("deleteCeQueue (ce_scanner_context)"); purgeMapper.deleteCeScannerContextOfCeQueueByRootUuid(rootUuid); session.commit(); profiler.stop(); profiler.start("deleteCeQueue (ce_task_characteristics)"); purgeMapper.deleteCeTaskCharacteristicsOfCeQueueByRootUuid(rootUuid); session.commit(); profiler.stop(); profiler.start("deleteCeQueue (ce_task_input)"); purgeMapper.deleteCeTaskInputOfCeQueueByRootUuid(rootUuid); session.commit(); profiler.stop(); profiler.start("deleteCeQueue (ce_task_message)"); purgeMapper.deleteCeTaskMessageOfCeQueueByRootUuid(rootUuid); session.commit(); profiler.stop(); profiler.start("deleteCeQueue (ce_queue)"); purgeMapper.deleteCeQueueByRootUuid(rootUuid); session.commit(); profiler.stop(); }
@Test public void shouldProfilePurge() { profiler.start("foo"); clock.sleep(10); profiler.stop(); profiler.start("bar"); clock.sleep(5); profiler.stop(); profiler.start("foo"); clock.sleep(8); profiler.stop(); profiler.dump(50, logger); verify(logger).info(contains("foo: 18ms")); verify(logger).info(contains("bar: 5ms")); }
@Test public void shouldResetPurgeProfiling() { profiler.start("foo"); clock.sleep(10); profiler.stop(); profiler.reset(); profiler.start("bar"); clock.sleep(5); profiler.stop(); profiler.start("foo"); clock.sleep(8); profiler.stop(); profiler.dump(50, logger); verify(logger).info(contains("foo: 8ms")); verify(logger).info(contains("bar: 5ms")); }