From a0d4bc39ec35534688047772797f42a38780bc29 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Tue, 5 Nov 2024 12:04:03 +0000 Subject: Test to highlight ModuleSetTag Inefficiencies - Add (micrometer) instrumentation to expose inefficiencies - Add test config for micrometer - Add setup methods in base to create many cm handles - Set module sync parallelism to 2 for testing - Add clean up methods for hazelcast related tests - added test to show inefficiencies - POC 1 use hazelcast set to prevent multiple threads working on same ModuleSetTag - POC 2 'cache' module set tags per thread to prevent DB looks ups - Main inefficiency left: create schemaset for EACH cm Handled even if same tag. No easy PoC... Change-Id: Idf46b44c475a24727dd7084bb613459f4c29be55 Signed-off-by: ToineSiebelink --- .../src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cps-ri/src') diff --git a/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java index 6f491ba3b7..3368aee148 100755 --- a/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java @@ -27,6 +27,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSet; +import io.micrometer.core.annotation.Timed; import jakarta.transaction.Transactional; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -186,6 +187,8 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ // can occur in case of specific concurrent requests. @Retryable(retryFor = DuplicatedYangResourceException.class, maxAttempts = 5, backoff = @Backoff(random = true, delay = 200, maxDelay = 2000, multiplier = 2)) + @Timed(value = "cps.module.persistence.schemaset.store", + description = "Time taken to store a schemaset (list of module references") public void storeSchemaSetFromModules(final String dataspaceName, final String schemaSetName, final Map newModuleNameToContentMap, final Collection allModuleReferences) { -- cgit 1.2.3-korg