diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2023-03-13 14:09:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-03-13 14:09:27 +0000 |
commit | 490834698eef6c8c0ef31c9a50f8695487b7f961 (patch) | |
tree | c4594cf83f1b78a515cc95ad992503508b2c45da /cps-ri/src/main | |
parent | 8e08dc797c89f6e85347c10cc7a2e877c126432a (diff) | |
parent | 03ded02d63b196fed2724b1a541457525c3885bc (diff) |
Merge "Add new metrics to the get data node method"
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 916baa8c23..593ed13344 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -25,6 +25,7 @@ package org.onap.cps.spi.impl; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; +import io.micrometer.core.annotation.Timed; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; @@ -80,7 +81,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService private final JsonObjectMapper jsonObjectMapper; private final SessionManager sessionManager; - private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@[\\s\\S]+?]){0,1})"; + private static final String REG_EX_FOR_OPTIONAL_LIST_INDEX = "(\\[@[\\s\\S]+?])?)"; @Override public void addChildDataNode(final String dataspaceName, final String anchorName, final String parentNodeXpath, @@ -250,6 +251,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService } @Override + @Timed(value = "cps.data.persistence.service.datanode.get", + description = "Time taken to get a data node") public Collection<DataNode> getDataNodes(final String dataspaceName, final String anchorName, final String xpath, final FetchDescendantsOption fetchDescendantsOption) { @@ -263,6 +266,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService } @Override + @Timed(value = "cps.data.persistence.service.datanode.batch.get", + description = "Time taken to get data nodes") public Collection<DataNode> getDataNodesForMultipleXpaths(final String dataspaceName, final String anchorName, final Collection<String> xpaths, final FetchDescendantsOption fetchDescendantsOption) { @@ -330,6 +335,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService } @Override + @Timed(value = "cps.data.persistence.service.datanode.query", + description = "Time taken to query data nodes") public List<DataNode> queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath, final FetchDescendantsOption fetchDescendantsOption) { final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); |