summaryrefslogtreecommitdiffstats
path: root/cps-rest
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2023-03-13 14:09:27 +0000
committerGerrit Code Review <gerrit@onap.org>2023-03-13 14:09:27 +0000
commit490834698eef6c8c0ef31c9a50f8695487b7f961 (patch)
treec4594cf83f1b78a515cc95ad992503508b2c45da /cps-rest
parent8e08dc797c89f6e85347c10cc7a2e877c126432a (diff)
parent03ded02d63b196fed2724b1a541457525c3885bc (diff)
Merge "Add new metrics to the get data node method"
Diffstat (limited to 'cps-rest')
-rwxr-xr-xcps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java5
-rw-r--r--cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java5
2 files changed, 10 insertions, 0 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
index 80cfb8ce0b..edfeab33ec 100755
--- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
@@ -24,6 +24,7 @@
package org.onap.cps.rest.controller;
+import io.micrometer.core.annotation.Timed;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
@@ -97,6 +98,8 @@ public class DataRestController implements CpsDataApi {
}
@Override
+ @Timed(value = "cps.data.controller.datanode.get.v1",
+ description = "Time taken to get data node")
public ResponseEntity<Object> getNodeByDataspaceAndAnchor(final String dataspaceName,
final String anchorName, final String xpath, final Boolean includeDescendants) {
final FetchDescendantsOption fetchDescendantsOption = Boolean.TRUE.equals(includeDescendants)
@@ -108,6 +111,8 @@ public class DataRestController implements CpsDataApi {
}
@Override
+ @Timed(value = "cps.data.controller.datanode.get.v2",
+ description = "Time taken to get data node")
public ResponseEntity<Object> getNodeByDataspaceAndAnchorV2(final String dataspaceName, final String anchorName,
final String xpath,
final String fetchDescendantsOptionAsString) {
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java
index 81938dcd95..5f4283d0e4 100644
--- a/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java
@@ -22,6 +22,7 @@
package org.onap.cps.rest.controller;
+import io.micrometer.core.annotation.Timed;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -49,6 +50,8 @@ public class QueryRestController implements CpsQueryApi {
private final PrefixResolver prefixResolver;
@Override
+ @Timed(value = "cps.data.controller.datanode.query.v1",
+ description = "Time taken to query data nodes")
public ResponseEntity<Object> getNodesByDataspaceAndAnchorAndCpsPath(final String dataspaceName,
final String anchorName, final String cpsPath, final Boolean includeDescendants) {
final FetchDescendantsOption fetchDescendantsOption = Boolean.TRUE.equals(includeDescendants)
@@ -58,6 +61,8 @@ public class QueryRestController implements CpsQueryApi {
}
@Override
+ @Timed(value = "cps.data.controller.datanode.query.v2",
+ description = "Time taken to query data nodes")
public ResponseEntity<Object> getNodesByDataspaceAndAnchorAndCpsPathV2(final String dataspaceName,
final String anchorName, final String cpsPath, final String fetchDescendantsOptionAsString) {
final FetchDescendantsOption fetchDescendantsOption =