summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2023-01-19 16:45:58 +0000
committerToineSiebelink <toine.siebelink@est.tech>2023-01-31 11:26:22 +0000
commit0fa2fabeec18763bab060d85f5123bceff8ee34c (patch)
tree3fc7b6bcd8344b8841b397a85beb01a20f9f34b0 /cps-ncmp-service
parent3d878b0674cd61e64501dfe6564b8921e76056bb (diff)
Introduce Instrumentation
- Add instrumentation related dependency - Added Timed Instrumentation - CPS-Service Crud methods - CPS Yang parsing - NCMP Registration methods - NCMP Events handling - Remove manual Gauge for YanResources Cache as (better!) instrumentation is already built into the 3PP - Sorted dependecies alphabetically (as we used to enforce, to prevent duplicates) - Added ## P E R F O R M A N C E T E S T R E S U L T S ### mini report - (unrelated) test improvement (because of bug that turned out to be invalid) Reviewers: Sourabh,Priyank, Luke Issue-ID: CPS-1457 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I34b20bece2f59488b022b8effa9470704c57be4d
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsCmHandleStateHandlerImpl.java7
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsService.java5
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java9
3 files changed, 15 insertions, 6 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsCmHandleStateHandlerImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsCmHandleStateHandlerImpl.java
index eba0389f20..6485fdf76b 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsCmHandleStateHandlerImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsCmHandleStateHandlerImpl.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation
+ * Copyright (C) 2022-2023 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import static org.onap.cps.ncmp.api.inventory.CmHandleState.DELETED;
import static org.onap.cps.ncmp.api.inventory.CmHandleState.LOCKED;
import static org.onap.cps.ncmp.api.inventory.CmHandleState.READY;
+import io.micrometer.core.annotation.Timed;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
@@ -74,6 +75,8 @@ public class LcmEventsCmHandleStateHandlerImpl implements LcmEventsCmHandleState
}
@Override
+ @Timed(value = "cps.ncmp.cmhandle.state.update.batch",
+ description = "Time taken to update a batch of cm handle states")
public void updateCmHandleStateBatch(final Map<YangModelCmHandle, CmHandleState> cmHandleStatePerCmHandle) {
final Collection<CmHandleTransitionPair> cmHandleTransitionPairs =
prepareCmHandleTransitionBatch(cmHandleStatePerCmHandle);
@@ -164,7 +167,6 @@ public class LcmEventsCmHandleStateHandlerImpl implements LcmEventsCmHandleState
}
-
private void updateToSpecifiedCmHandleState(final YangModelCmHandle yangModelCmHandle,
final CmHandleState targetCmHandleState) {
@@ -219,7 +221,6 @@ public class LcmEventsCmHandleStateHandlerImpl implements LcmEventsCmHandleState
@Setter
@NoArgsConstructor
static class CmHandleTransitionPair {
-
private YangModelCmHandle currentYangModelCmHandle;
private YangModelCmHandle targetYangModelCmHandle;
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsService.java
index d6857d36ae..a94d664de9 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsService.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/lcm/LcmEventsService.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation
+ * Copyright (C) 2022-2023 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
package org.onap.cps.ncmp.api.impl.event.lcm;
+import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.ncmp.cmhandle.event.lcm.LcmEvent;
@@ -50,6 +51,8 @@ public class LcmEventsService {
* @param cmHandleId Cm Handle Id
* @param lcmEvent Lcm Event
*/
+ @Timed(value = "cps.ncmp.lcm.events.publish",
+ description = "Time taken to publish a LCM event")
public void publishLcmEvent(final String cmHandleId, final LcmEvent lcmEvent) {
if (notificationsEnabled) {
try {
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java
index 5b0b5eafde..dd165853d1 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistenceImpl.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation
+ * Copyright (C) 2022-2023 Nordix Foundation
* Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,6 +26,7 @@ import static org.onap.cps.ncmp.api.impl.constants.DmiRegistryConstants.NO_TIMES
import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_ALLOWED;
import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS;
+import io.micrometer.core.annotation.Timed;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Collection;
@@ -140,6 +141,8 @@ public class InventoryPersistenceImpl implements InventoryPersistence {
}
@Override
+ @Timed(value = "cps.ncmp.inventory.persistence.schemaset.delete",
+ description = "Time taken to delete a schemaset")
public void deleteSchemaSetWithCascade(final String schemaSetName) {
try {
cpsValidator.validateNameCharacters(schemaSetName);
@@ -156,6 +159,8 @@ public class InventoryPersistenceImpl implements InventoryPersistence {
}
@Override
+ @Timed(value = "cps.ncmp.inventory.persistence.datanode.get",
+ description = "Time taken to get a data node (from ncmp dmi registry)")
public DataNode getDataNode(final String xpath, final FetchDescendantsOption fetchDescendantsOption) {
return cpsDataService.getDataNode(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR,
xpath, fetchDescendantsOption);
@@ -182,4 +187,4 @@ public class InventoryPersistenceImpl implements InventoryPersistence {
cpsDataService.deleteDataNode(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, dataNodeXpath,
NO_TIMESTAMP);
}
-} \ No newline at end of file
+}