aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cps-application/src/main/resources/application.yml5
-rw-r--r--cps-events/src/main/resources/schemas/cps.dataupdated/cps-data-updated-event-schema-1.0.0.json (renamed from cps-events/src/main/resources/schemas/updatenode/cps-data-updated-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/dmi/cm-events/avc-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/dmi/device-heartbeat/device-trust-level-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/trustlevel/device-trust-level-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/data-operation-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/async/data-operation-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/dmi-async-request-response-event-schema-v1.json (renamed from cps-ncmp-events/src/main/resources/schemas/dmi-async-request-response-event-schema-v1.json)1
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/ncmp-async-request-response-event-schema-v1.json (renamed from cps-ncmp-events/src/main/resources/schemas/ncmp-async-request-response-event-schema-v1.json)1
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/ncmpdataavc/avc-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-in-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-out-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-in-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json (renamed from cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-out-event-schema-1.0.0.json)0
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutor.java77
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java11
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdog.java38
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManager.java10
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/Sleeper.java35
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java14
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutorSpec.groovy63
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy18
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdogSpec.groovy49
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/utils/events/MessagingBaseSpec.groovy7
-rw-r--r--cps-ncmp-service/src/test/resources/application.yml4
-rw-r--r--cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java24
-rw-r--r--cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java4
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java14
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/impl/CpsQueryServiceImplSpec.groovy5
-rw-r--r--csit/tests/cps-trust-level/cps-trust-level.robot12
-rw-r--r--docker-compose/config/grafana/cps-database-pool.json886
-rw-r--r--docker-compose/config/grafana/data-dashboard.json14
-rw-r--r--docker-compose/config/grafana/inventory-dashboard.json16
-rw-r--r--docker-compose/config/grafana/jvm-micrometer-dashboard.json735
-rw-r--r--docker-compose/config/grafana/postgresql-statistics-dashboard.json112
-rw-r--r--docker-compose/docker-compose.yml7
-rw-r--r--docs/deployment.rst16
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy6
-rw-r--r--integration-test/src/test/java/org/onap/cps/integration/KafkaTestContainer.java11
-rw-r--r--integration-test/src/test/resources/application.yml5
-rw-r--r--k6-tests/ncmp/common/passthrough-crud.js6
39 files changed, 1179 insertions, 1027 deletions
diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml
index 6b9c694cf2..6eb9e108be 100644
--- a/cps-application/src/main/resources/application.yml
+++ b/cps-application/src/main/resources/application.yml
@@ -106,6 +106,7 @@ app:
cm-subscription-dmi-out: ${CM_SUBSCRIPTION_DMI_OUT_TOPIC:dmi-ncmp-cm-avc-subscription}
cm-subscription-ncmp-out: ${CM_SUBSCRIPTION_NCMP_OUT_TOPIC:subscription-response}
cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
+ inventory-events-topic: ncmp-inventory-events
lcm:
events:
topic: ${LCM_EVENTS_TOPIC:ncmp-events}
@@ -247,10 +248,6 @@ ncmp:
trust-level:
dmi-availability-watchdog-ms: 30000
- modules-sync-watchdog:
- async-executor:
- parallelism-level: 10
-
model-loader:
maximum-attempt-count: 20
diff --git a/cps-events/src/main/resources/schemas/updatenode/cps-data-updated-event-schema-1.0.0.json b/cps-events/src/main/resources/schemas/cps.dataupdated/cps-data-updated-event-schema-1.0.0.json
index a3eaf63fa4..a3eaf63fa4 100644
--- a/cps-events/src/main/resources/schemas/updatenode/cps-data-updated-event-schema-1.0.0.json
+++ b/cps-events/src/main/resources/schemas/cps.dataupdated/cps-data-updated-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/dmi/cm-events/avc-event-schema-1.0.0.json
index 474520d142..474520d142 100644
--- a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/dmi/cm-events/avc-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/trustlevel/device-trust-level-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/dmi/device-heartbeat/device-trust-level-event-schema-1.0.0.json
index e1796fbc73..e1796fbc73 100644
--- a/cps-ncmp-events/src/main/resources/schemas/trustlevel/device-trust-level-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/dmi/device-heartbeat/device-trust-level-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/async/data-operation-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/data-operation-event-schema-1.0.0.json
index c2915187c7..c2915187c7 100644
--- a/cps-ncmp-events/src/main/resources/schemas/async/data-operation-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/data-operation-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/dmi-async-request-response-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/dmi-async-request-response-event-schema-v1.json
index 2340a4bc4c..4db07bec95 100644
--- a/cps-ncmp-events/src/main/resources/schemas/dmi-async-request-response-event-schema-v1.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/dmi-async-request-response-event-schema-v1.json
@@ -6,6 +6,7 @@
"DmiAsyncRequestResponseEvent": {
"description": "The payload for NCMP async request response event.",
"type": "object",
+ "javaType" : "org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent",
"properties": {
"eventId": {
"description": "The unique id identifying the event generated by DMI.",
diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp-async-request-response-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/ncmp-async-request-response-event-schema-v1.json
index 51c2cf4d40..32b7becd05 100644
--- a/cps-ncmp-events/src/main/resources/schemas/ncmp-async-request-response-event-schema-v1.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/async-m2m/ncmp-async-request-response-event-schema-v1.json
@@ -6,6 +6,7 @@
"NcmpAsyncRequestResponseEvent": {
"description": "The payload for CPS async request response event.",
"type": "object",
+ "javaType" : "org.onap.cps.ncmp.event.model.NcmpAsyncRequestResponseEvent",
"properties": {
"eventId": {
"description": "The unique id identifying the event generated by DMI.",
diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmpdataavc/avc-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json
index d24ec2c737..d24ec2c737 100644
--- a/cps-ncmp-events/src/main/resources/schemas/ncmpdataavc/avc-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/avc-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json
index 93ec216e3d..93ec216e3d 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-in-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-in-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-out-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json
index 0910de1529..0910de1529 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/dmi-out-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/dmi-out-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json
index f8b6c2e680..f8b6c2e680 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-in-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-in-event-schema-1.0.0.json
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-out-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json
index 11dc4e1114..11dc4e1114 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/ncmp-out-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp/avc/ncmp-out-event-schema-1.0.0.json
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutor.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutor.java
deleted file mode 100644
index 80bc4ab69f..0000000000
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutor.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2024 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.ncmp.impl.inventory.sync;
-
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-import jakarta.annotation.PostConstruct;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeoutException;
-import java.util.function.Supplier;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-@Slf4j
-@Service
-public class AsyncTaskExecutor {
-
- @Value("${ncmp.modules-sync-watchdog.async-executor.parallelism-level:10}")
- @Getter
- private int asyncTaskParallelismLevel;
- private ExecutorService executorService;
- private static final int DEFAULT_PARALLELISM_LEVEL = 10;
-
- /**
- * Set up executor service with thread-pool size as per configuration parameter.
- * If modules-sync-watchdog.async-executor.parallelism-level not set a default of 10 threads will be applied.
- */
- @PostConstruct
- public void setupThreadPool() {
- executorService = Executors.newWorkStealingPool(
- asyncTaskParallelismLevel == 0 ? DEFAULT_PARALLELISM_LEVEL : asyncTaskParallelismLevel);
- }
-
- /**
- * Execute supplied task asynchronously.
- *
- * @param taskSupplier functional method is get() task need to executed asynchronously
- * @param timeOutInMillis the task timeout value in milliseconds
- */
- public void executeTask(final Supplier<Object> taskSupplier, final long timeOutInMillis) {
- CompletableFuture.supplyAsync(taskSupplier::get, executorService)
- .orTimeout(timeOutInMillis, MILLISECONDS)
- .whenCompleteAsync(this::handleTaskCompletion);
- }
-
- private void handleTaskCompletion(final Object response, final Throwable throwable) {
- if (throwable != null) {
- if (throwable instanceof TimeoutException) {
- log.error("Async task didn't complete within the required time.", throwable);
- } else {
- log.error("Watchdog async batch failed.", throwable);
- }
- }
- }
-}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java
index f039cf3c02..b727e79e70 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasks.java
@@ -24,8 +24,6 @@ import com.hazelcast.map.IMap;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicInteger;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.api.exceptions.DataNodeNotFoundException;
@@ -51,12 +49,8 @@ public class ModuleSyncTasks {
* Perform module sync on a batch of cm handles.
*
* @param cmHandleIds a batch of cm handle ids to perform module sync on
- * @param batchCounter the number of batches currently being processed, will be decreased when
- * task is finished or fails
- * @return completed future to handle post-processing
*/
- public CompletableFuture<Void> performModuleSync(final Collection<String> cmHandleIds,
- final AtomicInteger batchCounter) {
+ public void performModuleSync(final Collection<String> cmHandleIds) {
final Map<YangModelCmHandle, CmHandleState> cmHandleStatePerCmHandle = new HashMap<>(cmHandleIds.size());
try {
for (final String cmHandleId : cmHandleIds) {
@@ -74,11 +68,8 @@ public class ModuleSyncTasks {
}
}
} finally {
- batchCounter.getAndDecrement();
lcmEventsCmHandleStateHandler.updateCmHandleStateBatch(cmHandleStatePerCmHandle);
- log.info("Processing module sync batch finished. {} batch(es) active.", batchCounter.get());
}
- return CompletableFuture.completedFuture(null);
}
/**
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdog.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdog.java
index 32e1c49f17..6eefedb633 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdog.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdog.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2024 Nordix Foundation
+ * Copyright (C) 2022-2025 Nordix Foundation
* Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,13 +27,9 @@ import com.hazelcast.map.IMap;
import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.ncmp.impl.inventory.models.YangModelCmHandle;
-import org.onap.cps.ncmp.impl.utils.Sleeper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@@ -46,16 +42,10 @@ public class ModuleSyncWatchdog {
private final BlockingQueue<String> moduleSyncWorkQueue;
private final IMap<String, Object> moduleSyncStartedOnCmHandles;
private final ModuleSyncTasks moduleSyncTasks;
- private final AsyncTaskExecutor asyncTaskExecutor;
private final IMap<String, String> cpsAndNcmpLock;
- private final Sleeper sleeper;
private static final int MODULE_SYNC_BATCH_SIZE = 100;
- private static final long PREVENT_CPU_BURN_WAIT_TIME_MILLIS = 10;
private static final String VALUE_FOR_HAZELCAST_IN_PROGRESS_MAP = "Started";
- private static final long ASYNC_TASK_TIMEOUT_IN_MILLISECONDS = TimeUnit.MINUTES.toMillis(5);
- @Getter
- private AtomicInteger batchCounter = new AtomicInteger(1);
/**
* Check DB for any cm handles in 'ADVISED' state.
@@ -69,18 +59,11 @@ public class ModuleSyncWatchdog {
log.debug("Processing module sync watchdog waking up.");
populateWorkQueueIfNeeded();
while (!moduleSyncWorkQueue.isEmpty()) {
- if (batchCounter.get() <= asyncTaskExecutor.getAsyncTaskParallelismLevel()) {
- final Collection<String> nextBatch = prepareNextBatch();
- log.info("Processing module sync batch of {}. {} batch(es) active.",
- nextBatch.size(), batchCounter.get());
- if (!nextBatch.isEmpty()) {
- asyncTaskExecutor.executeTask(() ->
- moduleSyncTasks.performModuleSync(nextBatch, batchCounter),
- ASYNC_TASK_TIMEOUT_IN_MILLISECONDS);
- batchCounter.getAndIncrement();
- }
- } else {
- preventBusyWait();
+ final Collection<String> nextBatch = prepareNextBatch();
+ if (!nextBatch.isEmpty()) {
+ log.info("Processing module sync batch of {}. 1 batch(es) active.", nextBatch.size());
+ moduleSyncTasks.performModuleSync(nextBatch);
+ log.info("Processing module sync batch finished. 0 batch(es) active.");
}
}
}
@@ -153,13 +136,4 @@ public class ModuleSyncWatchdog {
log.info("nextBatch size : {}", nextBatch.size());
return nextBatch;
}
-
- private void preventBusyWait() {
- try {
- log.debug("Busy waiting now");
- sleeper.haveALittleRest(PREVENT_CPU_BURN_WAIT_TIME_MILLIS);
- } catch (final InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManager.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManager.java
index f68bb3b543..692bf5caee 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManager.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManager.java
@@ -193,14 +193,14 @@ public class TrustLevelManager {
final TrustLevel newEffectiveTrustLevel) {
if (oldEffectiveTrustLevel.equals(newEffectiveTrustLevel)) {
log.debug("The Cm Handle: {} has already the same trust level: {}", notificationCandidateCmHandleId,
- newEffectiveTrustLevel);
+ newEffectiveTrustLevel);
} else {
log.info("The trust level for Cm Handle: {} is now: {} ", notificationCandidateCmHandleId,
- newEffectiveTrustLevel);
+ newEffectiveTrustLevel);
cmAvcEventPublisher.publishAvcEvent(notificationCandidateCmHandleId,
- AVC_CHANGED_ATTRIBUTE_NAME,
- oldEffectiveTrustLevel.name(),
- newEffectiveTrustLevel.name());
+ AVC_CHANGED_ATTRIBUTE_NAME,
+ oldEffectiveTrustLevel.name(),
+ newEffectiveTrustLevel.name());
}
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/Sleeper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/Sleeper.java
deleted file mode 100644
index 7a02fa06e0..0000000000
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/Sleeper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.ncmp.impl.utils;
-
-import java.util.concurrent.TimeUnit;
-import org.springframework.stereotype.Service;
-
-/**
- * This class is to extract out sleep functionality so the interrupted exception handling can
- * be covered with a test (e.g. using spy on Sleeper) and help to get to 100% code coverage.
- */
-@Service
-public class Sleeper {
- public void haveALittleRest(final long timeInMillis) throws InterruptedException {
- TimeUnit.MILLISECONDS.sleep(timeInMillis);
- }
-}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java
index 2a9717cc1a..bdc7899724 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,8 +38,8 @@ public class CmAvcEventPublisher {
private final EventsPublisher<CloudEvent> eventsPublisher;
- @Value("${app.ncmp.avc.cm-events-topic}")
- private String avcTopic;
+ @Value("${app.ncmp.avc.inventory-events-topic}")
+ private String ncmpInventoryEventsTopicName;
/**
* Publish attribute value change event.
@@ -52,10 +52,10 @@ public class CmAvcEventPublisher {
final Map<String, String> extensions = createAvcEventExtensions(eventKey);
final CloudEvent avcCloudEvent =
- NcmpEvent.builder().type(AvcEvent.class.getTypeName())
- .data(avcEvent).extensions(extensions).build().asCloudEvent();
+ NcmpEvent.builder().type(AvcEvent.class.getTypeName())
+ .data(avcEvent).extensions(extensions).build().asCloudEvent();
- eventsPublisher.publishCloudEvent(avcTopic, eventKey, avcCloudEvent);
+ eventsPublisher.publishCloudEvent(ncmpInventoryEventsTopicName, eventKey, avcCloudEvent);
}
private AvcEvent buildAvcEvent(final String attributeName,
@@ -78,4 +78,4 @@ public class CmAvcEventPublisher {
extensions.put("correlationid", eventKey);
return extensions;
}
-}
+} \ No newline at end of file
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutorSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutorSpec.groovy
deleted file mode 100644
index 751c97a4d0..0000000000
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/AsyncTaskExecutorSpec.groovy
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.ncmp.impl.inventory.sync
-
-
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import spock.lang.Specification
-
-import java.util.concurrent.TimeoutException
-import java.util.function.Supplier
-
-@SpringBootTest(classes = AsyncTaskExecutor)
-class AsyncTaskExecutorSpec extends Specification {
-
- @Autowired
- AsyncTaskExecutor objectUnderTest
- def mockTaskSupplier = Mock(Supplier<Object>)
-
- def 'Parallelism level configuration.'() {
- expect: 'Parallelism level is configured with the correct value'
- assert objectUnderTest.getAsyncTaskParallelismLevel() == 3
- }
-
- def 'Task completion with #caseDescriptor.'() {
- when: 'task completion is handled'
- def irrelevantResponse = null
- objectUnderTest.handleTaskCompletion(irrelevantResponse, exception);
- then: 'any exception is swallowed by the task completion (logged)'
- noExceptionThrown()
- where: 'following cases are tested'
- caseDescriptor | exception
- 'no exception' | null
- 'time out exception' | new TimeoutException("time-out")
- 'unexpected exception' | new Exception("some exception")
- }
-
- def 'Task execution.'() {
- when: 'a task is submitted for execution'
- objectUnderTest.executeTask(() -> mockTaskSupplier, 0)
- then: 'the task submission is successful'
- noExceptionThrown()
- }
-
-}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy
index 92f4b38f31..98f3cc05bb 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncTasksSpec.groovy
@@ -39,8 +39,6 @@ import org.onap.cps.ncmp.impl.inventory.sync.lcm.LcmEventsCmHandleStateHandler
import org.slf4j.LoggerFactory
import spock.lang.Specification
-import java.util.concurrent.atomic.AtomicInteger
-
import static org.onap.cps.ncmp.api.inventory.models.LockReasonCategory.MODULE_SYNC_FAILED
import static org.onap.cps.ncmp.api.inventory.models.LockReasonCategory.MODULE_UPGRADE
import static org.onap.cps.ncmp.api.inventory.models.LockReasonCategory.MODULE_UPGRADE_FAILED
@@ -70,8 +68,6 @@ class ModuleSyncTasksSpec extends Specification {
.getOrCreateHazelcastInstance(new Config('hazelcastInstanceName'))
.getMap('mapInstanceName')
- def batchCount = new AtomicInteger(5)
-
def objectUnderTest = new ModuleSyncTasks(mockInventoryPersistence, mockSyncUtils, mockModuleSyncService,
mockLcmEventsCmHandleStateHandler, moduleSyncStartedOnCmHandles)
@@ -87,7 +83,7 @@ class ModuleSyncTasksSpec extends Specification {
mockInventoryPersistence.getYangModelCmHandle('cm-handle-1') >> cmHandle1
mockInventoryPersistence.getYangModelCmHandle('cm-handle-2') >> cmHandle2
when: 'module sync poll is executed'
- objectUnderTest.performModuleSync(['cm-handle-1', 'cm-handle-2'], batchCount)
+ objectUnderTest.performModuleSync(['cm-handle-1', 'cm-handle-2'])
then: 'module sync service is invoked for each cm handle'
1 * mockModuleSyncService.syncAndCreateSchemaSetAndAnchor(_) >> { args -> assert args[0].id == 'cm-handle-1' }
1 * mockModuleSyncService.syncAndCreateSchemaSetAndAnchor(_) >> { args -> assert args[0].id == 'cm-handle-2' }
@@ -95,8 +91,6 @@ class ModuleSyncTasksSpec extends Specification {
1 * mockLcmEventsCmHandleStateHandler.updateCmHandleStateBatch(_) >> { args ->
assertBatch(args, ['cm-handle-1', 'cm-handle-2'], CmHandleState.READY)
}
- and: 'batch count is decremented by one'
- assert batchCount.get() == 4
}
def 'Handle CM handle failure during #scenario and log MODULE_UPGRADE lock reason'() {
@@ -108,15 +102,13 @@ class ModuleSyncTasksSpec extends Specification {
mockModuleSyncService.syncAndCreateSchemaSetAndAnchor(_) >> { throw new Exception('some exception') }
mockModuleSyncService.syncAndUpgradeSchemaSet(_) >> { throw new Exception('some exception') }
when: 'module sync is executed'
- objectUnderTest.performModuleSync(['cm-handle'], batchCount)
+ objectUnderTest.performModuleSync(['cm-handle'])
then: 'lock reason is updated with number of attempts'
1 * mockSyncUtils.updateLockReasonWithAttempts(_, expectedLockReasonCategory, 'some exception')
and: 'the state handler is called to update the state to LOCKED'
1 * mockLcmEventsCmHandleStateHandler.updateCmHandleStateBatch(_) >> { args ->
assertBatch(args, ['cm-handle'], CmHandleState.LOCKED)
}
- and: 'batch count is decremented by one'
- assert batchCount.get() == 4
where:
scenario | lockReasonCategory | lockReasonDetails || expectedLockReasonCategory
'module sync' | MODULE_SYNC_FAILED | 'some lock details' || MODULE_SYNC_FAILED
@@ -132,7 +124,7 @@ class ModuleSyncTasksSpec extends Specification {
and: 'a cm handle in advised state'
mockInventoryPersistence.getYangModelCmHandle('cm-handle-3') >> cmHandleByIdAndState('cm-handle-3', CmHandleState.ADVISED)
when: 'module sync poll is executed'
- objectUnderTest.performModuleSync(['cm-handle-1', 'cm-handle-2', 'cm-handle-3'], batchCount)
+ objectUnderTest.performModuleSync(['cm-handle-1', 'cm-handle-2', 'cm-handle-3'])
then: 'no exception is thrown'
noExceptionThrown()
and: 'the deleted cm-handle did not sync'
@@ -176,7 +168,7 @@ class ModuleSyncTasksSpec extends Specification {
and: 'entry in progress map for other cm handle'
moduleSyncStartedOnCmHandles.put('other-cm-handle', 'started')
when: 'module sync poll is executed'
- objectUnderTest.performModuleSync(['cm-handle-1'], batchCount)
+ objectUnderTest.performModuleSync(['cm-handle-1'])
then: 'module sync service is invoked for cm handle'
1 * mockModuleSyncService.syncAndCreateSchemaSetAndAnchor(_) >> { args -> assert args[0].id == 'cm-handle-1' }
and: 'the entry for other cm handle is still in the progress map'
@@ -201,7 +193,7 @@ class ModuleSyncTasksSpec extends Specification {
cmHandle.compositeState.setLockReason(CompositeState.LockReason.builder().lockReasonCategory(lockReasonCategory).build())
mockInventoryPersistence.getYangModelCmHandle('cm-handle') >> cmHandle
when: 'module sync is executed'
- objectUnderTest.performModuleSync(['cm-handle'], batchCount)
+ objectUnderTest.performModuleSync(['cm-handle'])
then: 'the module sync service should attempt to sync and upgrade the CM handle'
1 * mockModuleSyncService.syncAndUpgradeSchemaSet(_) >> { args ->
assert args[0].id == 'cm-handle'
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdogSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdogSpec.groovy
index a9b88c2d3b..68aa6a1b6a 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdogSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncWatchdogSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2024 Nordix Foundation
+ * Copyright (C) 2022-2025 Nordix Foundation
* Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,14 +22,10 @@
package org.onap.cps.ncmp.impl.inventory.sync
import com.hazelcast.map.IMap
+import java.util.concurrent.ArrayBlockingQueue
import org.onap.cps.ncmp.impl.inventory.models.YangModelCmHandle
-import org.onap.cps.ncmp.impl.utils.Sleeper
-import org.onap.cps.api.model.DataNode
import spock.lang.Specification
-import java.util.concurrent.ArrayBlockingQueue
-import java.util.concurrent.locks.Lock
-
class ModuleSyncWatchdogSpec extends Specification {
def mockModuleOperationsUtils = Mock(ModuleOperationsUtils)
@@ -42,17 +38,9 @@ class ModuleSyncWatchdogSpec extends Specification {
def mockModuleSyncTasks = Mock(ModuleSyncTasks)
- def spiedAsyncTaskExecutor = Spy(AsyncTaskExecutor)
-
def mockCpsAndNcmpLock = Mock(IMap<String,String>)
- def spiedSleeper = Spy(Sleeper)
-
- def objectUnderTest = new ModuleSyncWatchdog(mockModuleOperationsUtils, moduleSyncWorkQueue , mockModuleSyncStartedOnCmHandles, mockModuleSyncTasks, spiedAsyncTaskExecutor, mockCpsAndNcmpLock, spiedSleeper)
-
- void setup() {
- spiedAsyncTaskExecutor.setupThreadPool()
- }
+ def objectUnderTest = new ModuleSyncWatchdog(mockModuleOperationsUtils, moduleSyncWorkQueue , mockModuleSyncStartedOnCmHandles, mockModuleSyncTasks, mockCpsAndNcmpLock)
def 'Module sync advised cm handles with #scenario.'() {
given: 'module sync utilities returns #numberOfAdvisedCmHandles advised cm handles'
@@ -61,12 +49,10 @@ class ModuleSyncWatchdogSpec extends Specification {
mockModuleOperationsUtils.getCmHandlesThatFailedModelSyncOrUpgrade() >> []
and: 'the work queue can be locked'
mockCpsAndNcmpLock.tryLock('workQueueLock') >> true
- and: 'the executor has enough available threads'
- spiedAsyncTaskExecutor.getAsyncTaskParallelismLevel() >> 3
when: ' module sync is started'
objectUnderTest.moduleSyncAdvisedCmHandles()
then: 'it performs #expectedNumberOfTaskExecutions tasks'
- expectedNumberOfTaskExecutions * spiedAsyncTaskExecutor.executeTask(*_)
+ expectedNumberOfTaskExecutions * mockModuleSyncTasks.performModuleSync(*_)
and: 'the executing thread is unlocked'
1 * mockCpsAndNcmpLock.unlock('workQueueLock')
where: 'the following parameter are used'
@@ -84,12 +70,10 @@ class ModuleSyncWatchdogSpec extends Specification {
mockModuleOperationsUtils.getAdvisedCmHandleIds() >> createCmHandleIds(1)
and: 'the work queue can be locked'
mockCpsAndNcmpLock.tryLock('workQueueLock') >> true
- and: 'the executor first has no threads but has one thread on the second attempt'
- spiedAsyncTaskExecutor.getAsyncTaskParallelismLevel() >>> [ 0, 1 ]
when: ' module sync is started'
objectUnderTest.moduleSyncAdvisedCmHandles()
then: 'it performs one task'
- 1 * spiedAsyncTaskExecutor.executeTask(*_)
+ 1 * mockModuleSyncTasks.performModuleSync(*_)
}
def 'Module sync advised cm handle already handled by other thread.'() {
@@ -97,27 +81,21 @@ class ModuleSyncWatchdogSpec extends Specification {
mockModuleOperationsUtils.getAdvisedCmHandleIds() >> createCmHandleIds(1)
and: 'the work queue can be locked'
mockCpsAndNcmpLock.tryLock('workQueueLock') >> true
- and: 'the executor has a thread available'
- spiedAsyncTaskExecutor.getAsyncTaskParallelismLevel() >> 1
and: 'the semaphore cache indicates the cm handle is already being processed'
mockModuleSyncStartedOnCmHandles.putIfAbsent(*_) >> 'Started'
- when: ' module sync is started'
+ when: 'module sync is started'
objectUnderTest.moduleSyncAdvisedCmHandles()
then: 'it does NOT execute a task to process the (empty) batch'
- 0 * spiedAsyncTaskExecutor.executeTask(*_)
+ 0 * mockModuleSyncTasks.performModuleSync(*_)
}
def 'Module sync with previous cm handle(s) left in work queue.'() {
given: 'there is still a cm handle in the queue'
moduleSyncWorkQueue.offer('ch-1')
- and: 'sync utilities returns many advise cm handles'
- mockModuleOperationsUtils.getAdvisedCmHandleIds() >> createCmHandleIds(500)
- and: 'the executor has plenty threads available'
- spiedAsyncTaskExecutor.getAsyncTaskParallelismLevel() >> 10
- when: ' module sync is started'
+ when: 'module sync is started'
objectUnderTest.moduleSyncAdvisedCmHandles()
then: 'it does executes only one task to process the remaining handle in the queue'
- 1 * spiedAsyncTaskExecutor.executeTask(*_)
+ 1 * mockModuleSyncTasks.performModuleSync(*_)
}
def 'Reset failed cm handles.'() {
@@ -147,15 +125,6 @@ class ModuleSyncWatchdogSpec extends Specification {
true || false || 1
}
- def 'Sleeper gets interrupted.'() {
- given: 'sleeper gets interrupted'
- spiedSleeper.haveALittleRest(_) >> { throw new InterruptedException() }
- when: 'the watchdog attempts to sleep to save cpu cycles'
- objectUnderTest.preventBusyWait()
- then: 'no exception is thrown'
- noExceptionThrown()
- }
-
def createCmHandleIds(numberOfCmHandles) {
return (numberOfCmHandles > 0) ? (1..numberOfCmHandles).collect { 'ch-'+it } : []
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/utils/events/MessagingBaseSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/utils/events/MessagingBaseSpec.groovy
index 377a1a6637..d38d5442f2 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/utils/events/MessagingBaseSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/utils/events/MessagingBaseSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (c) 2023 Nordix Foundation.
+ * Copyright (c) 2023-2025 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,8 +29,7 @@ import org.springframework.kafka.core.KafkaTemplate
import org.springframework.kafka.support.serializer.JsonSerializer
import org.springframework.test.context.DynamicPropertyRegistry
import org.springframework.test.context.DynamicPropertySource
-import org.testcontainers.containers.KafkaContainer
-import org.testcontainers.utility.DockerImageName
+import org.testcontainers.kafka.ConfluentKafkaContainer
import spock.lang.Specification
class MessagingBaseSpec extends Specification {
@@ -43,7 +42,7 @@ class MessagingBaseSpec extends Specification {
kafkaTestContainer.stop()
}
- static kafkaTestContainer = new KafkaContainer(DockerImageName.parse('registry.nordix.org/onaptest/confluentinc/cp-kafka:6.2.1').asCompatibleSubstituteFor('confluentinc/cp-kafka'))
+ static kafkaTestContainer = new ConfluentKafkaContainer("confluentinc/cp-kafka:7.8.0")
def legacyEventKafkaTemplate = new KafkaTemplate<>(new DefaultKafkaProducerFactory<String, String>(eventProducerConfigProperties(JsonSerializer)))
diff --git a/cps-ncmp-service/src/test/resources/application.yml b/cps-ncmp-service/src/test/resources/application.yml
index 12db639633..3276ceb534 100644
--- a/cps-ncmp-service/src/test/resources/application.yml
+++ b/cps-ncmp-service/src/test/resources/application.yml
@@ -77,10 +77,6 @@ ncmp:
trust-level:
dmi-availability-watchdog-ms: 30000
- modules-sync-watchdog:
- async-executor:
- parallelism-level: 3
-
policy-executor:
enabled: true
defaultDecision: "some default decision"
diff --git a/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
index 52fd7f2be1..ac6fe38ee7 100644
--- a/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation
+ * Copyright (C) 2021-2025 Nordix Foundation
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2020-2022 Bell Canada.
* Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
@@ -37,6 +37,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
@@ -230,6 +231,27 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
}
@Override
+ public <T> Set<T> queryDataLeaf(final String dataspaceName, final String anchorName, final String cpsPath,
+ final Class<T> targetClass) {
+ final CpsPathQuery cpsPathQuery = getCpsPathQuery(cpsPath);
+ if (!cpsPathQuery.hasAttributeAxis()) {
+ throw new IllegalArgumentException(
+ "Only Cps Path Queries with attribute-axis are supported by queryDataLeaf");
+ }
+
+ final String attributeName = cpsPathQuery.getAttributeAxisAttributeName();
+ final List<DataNode> dataNodes = queryDataNodes(dataspaceName, anchorName, cpsPath,
+ FetchDescendantsOption.OMIT_DESCENDANTS);
+ return dataNodes.stream()
+ .map(dataNode -> {
+ final Object attributeValue = dataNode.getLeaves().get(attributeName);
+ return targetClass.isInstance(attributeValue) ? targetClass.cast(attributeValue) : null;
+ })
+ .filter(Objects::nonNull)
+ .collect(Collectors.toSet());
+ }
+
+ @Override
@Timed(value = "cps.data.persistence.service.datanode.query.anchors",
description = "Time taken to query data nodes across all anchors or list of anchors")
public List<DataNode> queryDataNodesAcrossAnchors(final String dataspaceName, final String cpsPath,
diff --git a/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java b/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java
index 2687d8faee..508a1b2449 100644
--- a/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java
+++ b/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2024 Nordix Foundation
+ * Copyright (C) 2021-2025 Nordix Foundation
* Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,7 +54,7 @@ public class CpsQueryServiceImpl implements CpsQueryService {
public <T> Set<T> queryDataLeaf(final String dataspaceName, final String anchorName, final String cpsPath,
final Class<T> targetClass) {
cpsValidator.validateNameCharacters(dataspaceName, anchorName);
- throw new UnsupportedOperationException("Query by attribute-axis not implemented yet!");
+ return cpsDataPersistenceService.queryDataLeaf(dataspaceName, anchorName, cpsPath, targetClass);
}
@Override
diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java
index 5be5b1e2e0..a4f05cdb53 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2020-2024 Nordix Foundation.
+ * Copyright (C) 2020-2025 Nordix Foundation.
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2022 Bell Canada
* Modifications Copyright (C) 2022-2023 TechMahindra Ltd.
@@ -27,6 +27,7 @@ import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.onap.cps.api.model.DataNode;
import org.onap.cps.api.parameters.FetchDescendantsOption;
import org.onap.cps.api.parameters.PaginationOption;
@@ -185,6 +186,17 @@ public interface CpsDataPersistenceService {
String cpsPath, FetchDescendantsOption fetchDescendantsOption);
/**
+ * Get data leaf for the given dataspace and anchor by cps path.
+ *
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @param cpsPath cps path
+ * @param targetClass class of the expected data type
+ * @return a collection of data objects of expected type
+ */
+ <T> Set<T> queryDataLeaf(String dataspaceName, String anchorName, String cpsPath, Class<T> targetClass);
+
+ /**
* Get a datanode by dataspace name and cps path across all anchors.
*
* @param dataspaceName dataspace name
diff --git a/cps-service/src/test/groovy/org/onap/cps/impl/CpsQueryServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/impl/CpsQueryServiceImplSpec.groovy
index 237e4e4592..b15ee72370 100644
--- a/cps-service/src/test/groovy/org/onap/cps/impl/CpsQueryServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/impl/CpsQueryServiceImplSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2023 Nordix Foundation
+ * Copyright (C) 2021-2025 Nordix Foundation
* Modifications Copyright (C) 2023 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,11 +73,10 @@ class CpsQueryServiceImplSpec extends Specification {
1 * mockCpsDataPersistenceService.countAnchorsForDataspaceAndCpsPath("some-dataspace", "/cps-path")
}
- // TODO will be implemented in CPS-2416
def 'Query data leaf.'() {
when: 'a query for a specific leaf is executed'
objectUnderTest.queryDataLeaf('some-dataspace', 'some-anchor', '/cps-path/@id', Object.class)
then: 'solution is not implemented yet'
- thrown(UnsupportedOperationException)
+ 1 * mockCpsDataPersistenceService.queryDataLeaf('some-dataspace', 'some-anchor', '/cps-path/@id', Object.class)
}
}
diff --git a/csit/tests/cps-trust-level/cps-trust-level.robot b/csit/tests/cps-trust-level/cps-trust-level.robot
index 810bcf4d12..98ec665a6c 100644
--- a/csit/tests/cps-trust-level/cps-trust-level.robot
+++ b/csit/tests/cps-trust-level/cps-trust-level.robot
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,11 +46,11 @@ Register data node
Should Be Equal As Strings ${response.status_code} 200
Verify notification
- ${group_id}= Create Consumer auto_offset_reset=earliest
- Subscribe Topic topics=cm-events group_id=${group_id}
- ${result}= Poll group_id=${group_id} only_value=False poll_attempts=5
- ${headers} Set Variable ${result[0].headers()}
- ${payload} Set Variable ${result[0].value()}
+ ${group_id}= Create Consumer auto_offset_reset=earliest
+ Subscribe Topic topics=ncmp-inventory-events group_id=${group_id}
+ ${result}= Poll group_id=${group_id} only_value=False poll_attempts=5
+ ${headers} Set Variable ${result[0].headers()}
+ ${payload} Set Variable ${result[0].value()}
FOR ${header_key_value_pair} IN @{headers}
Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_specversion" "1.0"
Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_source" "NCMP"
diff --git a/docker-compose/config/grafana/cps-database-pool.json b/docker-compose/config/grafana/cps-database-pool.json
new file mode 100644
index 0000000000..37782af71a
--- /dev/null
+++ b/docker-compose/config/grafana/cps-database-pool.json
@@ -0,0 +1,886 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "datasource",
+ "uid": "grafana"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "type": "dashboard"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "enable": true,
+ "expr": "resets(process_uptime_seconds{application=\"$application\", region=\"$region\", instance=\"$instance\"}[1m]) > 0",
+ "hide": false,
+ "iconColor": "rgba(255, 96, 96, 1)",
+ "limit": 100,
+ "name": "Restart Detection",
+ "showIn": 0,
+ "step": "1m",
+ "tagKeys": "restart-tag",
+ "tags": [],
+ "textFormat": "uptime reset",
+ "titleFormat": "Restart",
+ "type": "tags"
+ }
+ ]
+ },
+ "description": "HikariCP & JDBC Dashboard (Micrometer.io)",
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 1,
+ "id": 16,
+ "links": [],
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 4,
+ "panels": [],
+ "title": "JDBC Connections",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 8,
+ "x": 0,
+ "y": 1
+ },
+ "id": 6,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "jdbc_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\", name=~\"$jdbc_connection_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "refId": "A"
+ }
+ ],
+ "title": "Min",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "fixedColor": "rgb(31, 120, 193)",
+ "mode": "fixed"
+ },
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 8,
+ "x": 8,
+ "y": 1
+ },
+ "id": 7,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "jdbc_connections_active{application=\"$application\", region=~\"$region\", instance=~\"$instance\", name=~\"$jdbc_connection_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "refId": "A"
+ }
+ ],
+ "title": "Active",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 8,
+ "x": 16,
+ "y": 1
+ },
+ "id": 8,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "jdbc_connections_max{application=\"$application\", region=~\"$region\", instance=~\"$instance\", name=~\"$jdbc_connection_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "refId": "A"
+ }
+ ],
+ "title": "Max",
+ "type": "stat"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 4
+ },
+ "id": 2,
+ "panels": [],
+ "title": "Hikari Connections",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 12,
+ "w": 21,
+ "x": 0,
+ "y": 5
+ },
+ "id": 10,
+ "options": {
+ "legend": {
+ "calcs": [
+ "max",
+ "min"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_active{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Active connections",
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_idle{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Idle connections",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_pending{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Pending threads",
+ "refId": "B"
+ }
+ ],
+ "title": "Connections",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 3,
+ "x": 21,
+ "y": 5
+ },
+ "id": 12,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_max{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "refId": "A"
+ }
+ ],
+ "title": "Max",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 3,
+ "x": 21,
+ "y": 9
+ },
+ "id": 13,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "refId": "A"
+ }
+ ],
+ "title": "Min",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 3,
+ "x": 21,
+ "y": 13
+ },
+ "id": 17,
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "hikaricp_connections_timeout_total{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "Total Timeout",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "never",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "dtdurations"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 24,
+ "x": 0,
+ "y": 17
+ },
+ "id": 16,
+ "options": {
+ "legend": {
+ "calcs": [
+ "max",
+ "min"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "multi",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "11.3.1",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "irate(hikaricp_connections_usage_seconds_sum{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m]) / irate(hikaricp_connections_usage_seconds_count{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m])",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Usage time",
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "irate(hikaricp_connections_creation_seconds_sum{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m]) / irate(hikaricp_connections_creation_seconds_count{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m])",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Creation time",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "expr": "irate(hikaricp_connections_acquire_seconds_sum{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m]) / irate(hikaricp_connections_acquire_seconds_count{application=\"$application\", region=~\"$region\", instance=~\"$instance\", pool=~\"$hikaricp_pool_name\"}[5m])",
+ "format": "time_series",
+ "intervalFactor": 1,
+ "legendFormat": "Acquire time",
+ "refId": "B"
+ }
+ ],
+ "title": "Connections Time",
+ "type": "timeseries"
+ }
+ ],
+ "preload": false,
+ "refresh": "5s",
+ "schemaVersion": 40,
+ "tags": [
+ "prometheus",
+ "hikaricp",
+ "micrometer",
+ "spring boot",
+ "jdbc"
+ ],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "text": "",
+ "value": ""
+ },
+ "datasource": "PBFA97CFB590B2093",
+ "definition": "",
+ "includeAll": false,
+ "label": "Application",
+ "name": "application",
+ "options": [],
+ "query": "label_values(application)",
+ "refresh": 2,
+ "regex": "",
+ "type": "query"
+ },
+ {
+ "current": {
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": "PBFA97CFB590B2093",
+ "definition": "",
+ "includeAll": true,
+ "label": "Region",
+ "name": "region",
+ "options": [],
+ "query": "label_values(jdbc_connections_min{application=\"$application\"}, region)",
+ "refresh": 1,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "current": {
+ "text": "129.192.80.24:9998",
+ "value": "129.192.80.24:9998"
+ },
+ "datasource": "PBFA97CFB590B2093",
+ "definition": "label_values(jdbc_connections_min{application=\"$application\", region=~\"$region\"}, instance)",
+ "includeAll": true,
+ "label": "Instance",
+ "name": "instance",
+ "options": [],
+ "query": "label_values(jdbc_connections_min{application=\"$application\", region=~\"$region\"}, instance)",
+ "refresh": 2,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "current": {
+ "text": "dataSource",
+ "value": "dataSource"
+ },
+ "datasource": "PBFA97CFB590B2093",
+ "definition": "label_values(jdbc_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\"}, name)",
+ "includeAll": false,
+ "label": "JDBC Connection Name",
+ "name": "jdbc_connection_name",
+ "options": [],
+ "query": "label_values(jdbc_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\"}, name)",
+ "refresh": 2,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "current": {
+ "text": "CpsDatabasePool",
+ "value": "CpsDatabasePool"
+ },
+ "datasource": "PBFA97CFB590B2093",
+ "definition": "label_values(hikaricp_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\"}, pool)",
+ "includeAll": false,
+ "label": "Hikari Pool Name",
+ "name": "hikaricp_pool_name",
+ "options": [],
+ "query": "label_values(hikaricp_connections_min{application=\"$application\", region=~\"$region\", instance=~\"$instance\"}, pool)",
+ "refresh": 2,
+ "regex": "",
+ "sort": 1,
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-1h",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "",
+ "title": "Cps Database Pool",
+ "uid": "wdV6wx7iz",
+ "version": 1,
+ "weekStart": ""
+} \ No newline at end of file
diff --git a/docker-compose/config/grafana/data-dashboard.json b/docker-compose/config/grafana/data-dashboard.json
index a75e7a59ea..4fbb65ee5b 100644
--- a/docker-compose/config/grafana/data-dashboard.json
+++ b/docker-compose/config/grafana/data-dashboard.json
@@ -19,7 +19,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
- "id": 13,
+ "id": 2,
"links": [],
"panels": [
{
@@ -101,7 +101,7 @@
"sort": "none"
}
},
- "pluginVersion": "11.3.1",
+ "pluginVersion": "11.4.0",
"targets": [
{
"disableTextWrap": false,
@@ -197,7 +197,7 @@
"sort": "none"
}
},
- "pluginVersion": "11.3.1",
+ "pluginVersion": "11.4.0",
"targets": [
{
"disableTextWrap": false,
@@ -219,9 +219,9 @@
"refresh": "5s",
"schemaVersion": 40,
"tags": [
- "CPS",
- "NCMP",
- "k6"
+ "ncmp",
+ "data",
+ "api"
],
"templating": {
"list": [
@@ -271,6 +271,6 @@
"timezone": "browser",
"title": "Data REST Interfaces",
"uid": "aeavdgvjyt2iob",
- "version": 5,
+ "version": 1,
"weekStart": ""
} \ No newline at end of file
diff --git a/docker-compose/config/grafana/inventory-dashboard.json b/docker-compose/config/grafana/inventory-dashboard.json
index f6a7e8cbb2..959995fa69 100644
--- a/docker-compose/config/grafana/inventory-dashboard.json
+++ b/docker-compose/config/grafana/inventory-dashboard.json
@@ -18,7 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
- "id": 12,
+ "id": 3,
"links": [],
"panels": [
{
@@ -100,7 +100,7 @@
"sort": "none"
}
},
- "pluginVersion": "11.3.1",
+ "pluginVersion": "11.4.0",
"targets": [
{
"disableTextWrap": false,
@@ -196,7 +196,7 @@
"sort": "none"
}
},
- "pluginVersion": "11.3.1",
+ "pluginVersion": "11.4.0",
"targets": [
{
"disableTextWrap": false,
@@ -292,7 +292,7 @@
"sort": "none"
}
},
- "pluginVersion": "11.3.1",
+ "pluginVersion": "11.4.0",
"targets": [
{
"disableTextWrap": false,
@@ -313,9 +313,9 @@
"preload": false,
"schemaVersion": 40,
"tags": [
- "CPS",
- "NCMP",
- "k6"
+ "lcm-state",
+ "inventory",
+ "ncmp"
],
"templating": {
"list": [
@@ -365,6 +365,6 @@
"timezone": "browser",
"title": "Inventory REST Interfaces",
"uid": "beao8xrt6qjnkc",
- "version": 7,
+ "version": 1,
"weekStart": ""
} \ No newline at end of file
diff --git a/docker-compose/config/grafana/jvm-micrometer-dashboard.json b/docker-compose/config/grafana/jvm-micrometer-dashboard.json
index 8f7747c596..9f09d2e2cb 100644
--- a/docker-compose/config/grafana/jvm-micrometer-dashboard.json
+++ b/docker-compose/config/grafana/jvm-micrometer-dashboard.json
@@ -22,6 +22,7 @@
},
"enable": true,
"expr": "resets(process_uptime_seconds{application=\"$application\", instance=\"$instance\"}[1m]) > 0",
+ "hide": false,
"iconColor": "rgba(255, 96, 96, 1)",
"name": "Restart Detection",
"showIn": 0,
@@ -35,17 +36,12 @@
"description": "Dashboard for Micrometer instrumented applications (Java, Spring Boot, Micronaut)",
"editable": true,
"fiscalYearStartMonth": 0,
- "gnetId": 4701,
"graphTooltip": 1,
- "id": 1,
+ "id": 3,
"links": [],
"panels": [
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -54,15 +50,6 @@
},
"id": 139,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "Quick Facts",
"type": "row"
},
@@ -73,6 +60,10 @@
},
"fieldConfig": {
"defaults": {
+ "color": {
+ "fixedColor": "green",
+ "mode": "fixed"
+ },
"decimals": 1,
"mappings": [
{
@@ -127,7 +118,7 @@
"textMode": "auto",
"wideLayout": true
},
- "pluginVersion": "11.1.4",
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -153,6 +144,10 @@
},
"fieldConfig": {
"defaults": {
+ "color": {
+ "fixedColor": "green",
+ "mode": "fixed"
+ },
"mappings": [
{
"options": {
@@ -206,7 +201,7 @@
"textMode": "auto",
"wideLayout": true
},
- "pluginVersion": "11.1.4",
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -292,7 +287,7 @@
"textMode": "auto",
"wideLayout": true
},
- "pluginVersion": "11.1.4",
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -387,7 +382,7 @@
"textMode": "auto",
"wideLayout": true
},
- "pluginVersion": "11.1.4",
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -407,10 +402,6 @@
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -419,15 +410,6 @@
},
"id": 140,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "I/O Overview",
"type": "row"
},
@@ -448,6 +430,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -513,6 +496,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -546,6 +530,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -642,6 +627,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -675,6 +661,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -740,6 +727,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -787,6 +775,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -852,6 +841,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -931,10 +921,6 @@
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -943,15 +929,6 @@
},
"id": 141,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "JVM Memory",
"type": "row"
},
@@ -972,6 +949,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1038,6 +1016,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1097,6 +1076,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1163,6 +1143,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1223,6 +1204,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1289,6 +1271,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1348,6 +1331,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1414,6 +1398,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1468,10 +1453,6 @@
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -1480,15 +1461,6 @@
},
"id": 142,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "JVM Misc",
"type": "row"
},
@@ -1509,6 +1481,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1577,6 +1550,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1637,6 +1611,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1704,6 +1679,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1750,6 +1726,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -1817,6 +1794,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -1890,6 +1868,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -2046,6 +2025,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -2080,6 +2060,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -2148,6 +2129,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -2181,6 +2163,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -2324,6 +2307,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -2360,6 +2344,7 @@
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
+ "barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
@@ -2428,6 +2413,7 @@
"sort": "none"
}
},
+ "pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
@@ -2463,10 +2449,6 @@
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -2476,15 +2458,6 @@
"id": 143,
"panels": [],
"repeat": "persistence_counts",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "JVM Memory Pools (Heap)",
"type": "row"
},
@@ -2536,8 +2509,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -2551,7 +2523,7 @@
},
"gridPos": {
"h": 7,
- "w": 8,
+ "w": 24,
"x": 0,
"y": 36
},
@@ -2572,6 +2544,7 @@
}
},
"repeat": "jvm_memory_pool_heap",
+ "repeatDirection": "h",
"targets": [
{
"datasource": {
@@ -2624,10 +2597,6 @@
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
@@ -2636,66 +2605,29 @@
},
"id": 144,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "JVM Memory Pools (Non-Heap)",
"type": "row"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "editable": true,
- "error": false,
- "fill": 1,
- "grid": {
- "leftLogBase": 1,
- "rightLogBase": 1
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
},
"gridPos": {
"h": 7,
- "w": 8,
+ "w": 24,
"x": 0,
"y": 44
},
"id": 78,
- "legend": {
- "alignAsTable": false,
- "avg": false,
- "current": true,
- "max": true,
- "min": false,
- "rightSide": false,
- "show": true,
- "total": false,
- "values": true
- },
- "lines": true,
- "linewidth": 1,
"maxPerRow": 3,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
+ "options": {},
"repeat": "jvm_memory_pool_nonheap",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "repeatDirection": "h",
"targets": [
{
"datasource": {
@@ -2743,104 +2675,39 @@
"step": 1800
}
],
- "thresholds": [],
"title": "$jvm_memory_pool_nonheap",
- "tooltip": {
- "msResolution": false,
- "shared": true,
- "sort": 0,
- "value_type": "cumulative"
- },
- "type": "timeseries",
- "x-axis": true,
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "y-axis": true,
- "y_formats": [
- "mbytes",
- "short"
- ],
- "yaxes": [
- {
- "format": "bytes",
- "logBase": 1,
- "min": 0,
- "show": true
- },
- {
- "format": "short",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
- "y": 58
+ "y": 51
},
"id": 145,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "Garbage Collection",
"type": "row"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "fill": 1,
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
+ },
"gridPos": {
"h": 7,
"w": 8,
"x": 0,
- "y": 59
+ "y": 52
},
"id": 98,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "options": {},
"targets": [
{
"datasource": {
@@ -2855,72 +2722,26 @@
"refId": "A"
}
],
- "thresholds": [],
"title": "Collections",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "timeseries",
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "ops",
- "logBase": 1,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": "",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "fill": 1,
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
+ },
"gridPos": {
"h": 7,
"w": 8,
"x": 8,
- "y": 59
+ "y": 52
},
"id": 101,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "options": {},
"targets": [
{
"datasource": {
@@ -2949,72 +2770,26 @@
"refId": "B"
}
],
- "thresholds": [],
"title": "Pause Durations",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "timeseries",
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "s",
- "logBase": 1,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": "",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "fill": 1,
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
+ },
"gridPos": {
"h": 7,
"w": 8,
"x": 16,
- "y": 59
+ "y": 52
},
"id": 99,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "options": {},
"targets": [
{
"datasource": {
@@ -3041,103 +2816,39 @@
"refId": "B"
}
],
- "thresholds": [],
"title": "Allocated/Promoted",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "timeseries",
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "Bps",
- "logBase": 1,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
- "y": 66
+ "y": 59
},
"id": 146,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "Classloading",
"type": "row"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "editable": true,
- "error": false,
- "fill": 1,
- "grid": {
- "leftLogBase": 1,
- "rightLogBase": 1
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
- "y": 67
+ "y": 60
},
"id": 37,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "options": {},
"targets": [
{
"datasource": {
@@ -3153,84 +2864,26 @@
"step": 1200
}
],
- "thresholds": [],
"title": "Classes loaded",
- "tooltip": {
- "msResolution": false,
- "shared": true,
- "sort": 0,
- "value_type": "cumulative"
- },
- "type": "timeseries",
- "x-axis": true,
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "y-axis": true,
- "y_formats": [
- "short",
- "short"
- ],
- "yaxes": [
- {
- "format": "short",
- "logBase": 1,
- "min": 0,
- "show": true
- },
- {
- "format": "short",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "editable": true,
- "error": false,
- "fill": 1,
- "grid": {
- "leftLogBase": 1,
- "rightLogBase": 1
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
- "y": 67
+ "y": 60
},
"id": 38,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "options": {},
"targets": [
{
"datasource": {
@@ -3248,115 +2901,42 @@
"step": 1200
}
],
- "thresholds": [],
"title": "Class delta",
- "tooltip": {
- "msResolution": false,
- "shared": true,
- "sort": 0,
- "value_type": "cumulative"
- },
- "type": "timeseries",
- "x-axis": true,
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "y-axis": true,
- "y_formats": [
- "ops",
- "short"
- ],
- "yaxes": [
- {
- "format": "short",
- "label": "",
- "logBase": 1,
- "show": true
- },
- {
- "format": "short",
- "logBase": 1,
- "show": true
- }
- ]
+ "type": "timeseries"
},
{
"collapsed": false,
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
- "y": 74
+ "y": 67
},
"id": 147,
"panels": [],
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "PBFA97CFB590B2093"
- },
- "refId": "A"
- }
- ],
"title": "Buffer Pools",
"type": "row"
},
{
- "aliasColors": {},
- "autoMigrateFrom": "graph",
- "bars": false,
- "dashLength": 10,
- "dashes": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
- "fill": 1,
+ "fieldConfig": {
+ "defaults": {},
+ "overrides": []
+ },
"gridPos": {
"h": 7,
- "w": 8,
+ "w": 24,
"x": 0,
- "y": 75
+ "y": 68
},
"id": 131,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
"maxPerRow": 3,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
+ "options": {},
"repeat": "jvm_buffer_pool",
- "seriesOverrides": [
- {
- "alias": "count",
- "yaxis": 2
- },
- {
- "alias": "buffers",
- "yaxis": 2
- }
- ],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
+ "repeatDirection": "h",
"targets": [
{
"datasource": {
@@ -3393,46 +2973,23 @@
"refId": "C"
}
],
- "thresholds": [],
"title": "$jvm_buffer_pool",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "timeseries",
- "xaxis": {
- "mode": "time",
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "decbytes",
- "logBase": 1,
- "min": "0",
- "show": true
- },
- {
- "decimals": 0,
- "format": "short",
- "label": "",
- "logBase": 1,
- "min": "0",
- "show": true
- }
- ]
+ "type": "timeseries"
}
],
+ "preload": false,
"refresh": "auto",
- "schemaVersion": 39,
- "tags": [],
+ "schemaVersion": 40,
+ "tags": [
+ "jvm",
+ "prometheus",
+ "micrometer"
+ ],
"templating": {
"list": [
{
"current": {
"isNone": true,
- "selected": false,
"text": "None",
"value": ""
},
@@ -3441,26 +2998,17 @@
"uid": "PBFA97CFB590B2093"
},
"definition": "",
- "hide": 0,
"includeAll": false,
"label": "Application",
- "multi": false,
"name": "application",
"options": [],
"query": "label_values(application)",
"refresh": 2,
"regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "tagValuesQuery": "",
- "tagsQuery": "",
- "type": "query",
- "useTags": false
+ "type": "query"
},
{
- "allFormat": "glob",
"current": {
- "selected": false,
"text": "docker-compose-cps-and-ncmp-1:8080",
"value": "docker-compose-cps-and-ncmp-1:8080"
},
@@ -3469,27 +3017,17 @@
"uid": "PBFA97CFB590B2093"
},
"definition": "",
- "hide": 0,
"includeAll": false,
"label": "Instance",
- "multi": false,
- "multiFormat": "glob",
"name": "instance",
"options": [],
"query": "label_values(jvm_memory_used_bytes{application=\"$application\"}, instance)",
"refresh": 2,
"regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "tagValuesQuery": "",
- "tagsQuery": "",
- "type": "query",
- "useTags": false
+ "type": "query"
},
{
- "allFormat": "glob",
"current": {
- "selected": false,
"text": "All",
"value": "$__all"
},
@@ -3501,24 +3039,16 @@
"hide": 2,
"includeAll": true,
"label": "JVM Memory Pools Heap",
- "multi": false,
- "multiFormat": "glob",
"name": "jvm_memory_pool_heap",
"options": [],
"query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"},id)",
"refresh": 1,
"regex": "",
- "skipUrlSync": false,
"sort": 1,
- "tagValuesQuery": "",
- "tagsQuery": "",
- "type": "query",
- "useTags": false
+ "type": "query"
},
{
- "allFormat": "glob",
"current": {
- "selected": false,
"text": "All",
"value": "$__all"
},
@@ -3530,24 +3060,16 @@
"hide": 2,
"includeAll": true,
"label": "JVM Memory Pools Non-Heap",
- "multi": false,
- "multiFormat": "glob",
"name": "jvm_memory_pool_nonheap",
"options": [],
"query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"},id)",
"refresh": 1,
"regex": "",
- "skipUrlSync": false,
"sort": 2,
- "tagValuesQuery": "",
- "tagsQuery": "",
- "type": "query",
- "useTags": false
+ "type": "query"
},
{
- "allFormat": "glob",
"current": {
- "selected": false,
"text": "All",
"value": "$__all"
},
@@ -3559,19 +3081,13 @@
"hide": 2,
"includeAll": true,
"label": "JVM Buffer Pools",
- "multi": false,
- "multiFormat": "glob",
"name": "jvm_buffer_pool",
"options": [],
"query": "label_values(jvm_buffer_memory_used_bytes{application=\"$application\", instance=\"$instance\"},id)",
"refresh": 1,
"regex": "",
- "skipUrlSync": false,
"sort": 1,
- "tagValuesQuery": "",
- "tagsQuery": "",
- "type": "query",
- "useTags": false
+ "type": "query"
}
]
},
@@ -3579,35 +3095,10 @@
"from": "now-30m",
"to": "now"
},
- "timepicker": {
- "now": true,
- "refresh_intervals": [
- "5s",
- "10s",
- "30s",
- "1m",
- "5m",
- "15m",
- "30m",
- "1h",
- "2h",
- "1d"
- ],
- "time_options": [
- "5m",
- "15m",
- "1h",
- "6h",
- "12h",
- "24h",
- "2d",
- "7d",
- "30d"
- ]
- },
+ "timepicker": {},
"timezone": "browser",
"title": "JVM (Micrometer)",
"uid": "bdvp1kgecrda8f",
"version": 1,
"weekStart": ""
-}
+} \ No newline at end of file
diff --git a/docker-compose/config/grafana/postgresql-statistics-dashboard.json b/docker-compose/config/grafana/postgresql-statistics-dashboard.json
index 491649ea87..afc428f8cf 100644
--- a/docker-compose/config/grafana/postgresql-statistics-dashboard.json
+++ b/docker-compose/config/grafana/postgresql-statistics-dashboard.json
@@ -25,7 +25,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
- "id": 4,
+ "id": 5,
"links": [],
"panels": [
{
@@ -107,7 +107,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_static{app=\"$app\"}",
+ "expr": "pg_static{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -184,7 +184,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_max_connections{app=\"$app\"}",
+ "expr": "pg_settings_max_connections{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -261,7 +261,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_shared_buffers_bytes{app=\"$app\"}",
+ "expr": "pg_settings_shared_buffers_bytes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -338,7 +338,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_effective_cache_size_bytes{app=\"$app\"}",
+ "expr": "pg_settings_effective_cache_size_bytes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -415,7 +415,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_maintenance_work_mem_bytes{app=\"$app\"}",
+ "expr": "pg_settings_maintenance_work_mem_bytes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -492,7 +492,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_work_mem_bytes{app=\"$app\"}",
+ "expr": "pg_settings_work_mem_bytes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -570,7 +570,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_max_wal_size_bytes{app=\"$app\"}",
+ "expr": "pg_settings_max_wal_size_bytes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -647,7 +647,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_random_page_cost{app=\"$app\"}",
+ "expr": "pg_settings_random_page_cost{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -724,7 +724,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_seq_page_cost{app=\"$app\"}",
+ "expr": "pg_settings_seq_page_cost{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -801,7 +801,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_max_worker_processes{app=\"$app\"}",
+ "expr": "pg_settings_max_worker_processes{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -878,7 +878,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_settings_max_parallel_workers{app=\"$app\"}",
+ "expr": "pg_settings_max_parallel_workers{instance=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -989,7 +989,7 @@
{
"datasource": "PBFA97CFB590B2093",
"editorMode": "code",
- "expr": "pg_database_size_bytes{app=\"$app\", datname=\"$db\"}",
+ "expr": "pg_database_size_bytes{instance=\"$instance\", datname=\"$db\"}",
"legendFormat": "size",
"range": true,
"refId": "A"
@@ -1098,7 +1098,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_stat_activity_count{app=\"$app\", datname=\"$db\"}",
+ "expr": "pg_stat_activity_count{instance=\"$instance\", datname=\"$db\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1191,7 +1191,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_xact_commit{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_xact_commit{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1201,7 +1201,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_xact_rollback{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_xact_rollback{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1257,8 +1257,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1299,7 +1298,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_tup_fetched{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_tup_fetched{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1309,7 +1308,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_tup_returned{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_tup_returned{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1365,8 +1364,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1407,7 +1405,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_tup_inserted{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_tup_inserted{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1417,7 +1415,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_tup_updated{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_tup_updated{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1427,7 +1425,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_tup_deleted{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_tup_deleted{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1483,8 +1481,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1525,7 +1522,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_stat_activity_max_tx_duration{app=\"$app\", datname=\"$db\"}",
+ "expr": "pg_stat_activity_max_tx_duration{instance=\"$instance\", datname=\"$db\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1582,8 +1579,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1619,7 +1615,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_stat_database_blks_hit{app=\"$app\", datname=\"$db\"} / (pg_stat_database_blks_read{app=\"$app\", datname=\"$db\"} + pg_stat_database_blks_hit{app=\"$app\", datname=\"$db\"})",
+ "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=\"$db\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=\"$db\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=\"$db\"})",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1688,8 +1684,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1730,7 +1725,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_buffers_backend_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_buffers_backend_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1740,7 +1735,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_buffers_alloc_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_buffers_alloc_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1750,7 +1745,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1760,7 +1755,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_buffers_checkpoint_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_buffers_checkpoint_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1770,7 +1765,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_buffers_clean_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_buffers_clean_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1826,8 +1821,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1863,7 +1857,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_conflicts{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_conflicts{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1873,7 +1867,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_deadlocks{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_deadlocks{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -1930,8 +1924,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1972,7 +1965,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "pg_locks_count{app=\"$app\", datname=\"$db\"}",
+ "expr": "pg_locks_count{instance=\"$instance\", datname=\"$db\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -2029,8 +2022,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -2066,7 +2058,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_database_temp_bytes{app=\"$app\", datname=\"$db\"}[5m])",
+ "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=\"$db\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -2122,8 +2114,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -2164,7 +2155,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_checkpoint_write_time_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_checkpoint_write_time_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -2174,7 +2165,7 @@
{
"datasource": "PBFA97CFB590B2093",
"exemplar": true,
- "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time_total{app=\"$app\"}[5m])",
+ "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time_total{instance=\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
@@ -2189,7 +2180,10 @@
"preload": false,
"refresh": "5s",
"schemaVersion": 40,
- "tags": [],
+ "tags": [
+ "postgresql",
+ "postgres-exporter"
+ ],
"templating": {
"list": [
{
@@ -2198,13 +2192,13 @@
"value": ""
},
"datasource": "PBFA97CFB590B2093",
- "definition": "label_values(pg_up, app)",
+ "definition": "label_values(pg_up, instance)",
"includeAll": false,
- "label": "App",
- "name": "app",
+ "label": "instance",
+ "name": "instance",
"options": [],
"query": {
- "query": "label_values(pg_up, app)",
+ "query": "label_values(pg_up, instance)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
@@ -2217,13 +2211,13 @@
"value": "cpsdb"
},
"datasource": "PBFA97CFB590B2093",
- "definition": "label_values(pg_stat_database_tup_fetched{datname!~\"template.*|postgres\",app=\"$app\"},datname)",
+ "definition": "label_values(pg_stat_database_tup_fetched{datname!~\"template.*|postgres\",instance=\"$instance\"},datname)",
"includeAll": false,
"label": "Database",
"name": "db",
"options": [],
"query": {
- "query": "label_values(pg_stat_database_tup_fetched{datname!~\"template.*|postgres\",app=\"$app\"},datname)",
+ "query": "label_values(pg_stat_database_tup_fetched{datname!~\"template.*|postgres\",instance=\"$instance\"},datname)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml
index 11a2c7912e..b669c06695 100644
--- a/docker-compose/docker-compose.yml
+++ b/docker-compose/docker-compose.yml
@@ -96,7 +96,7 @@ services:
### if kafka is not required comment out zookeeper and kafka ###
zookeeper:
- image: confluentinc/cp-zookeeper:6.2.1
+ image: confluentinc/cp-zookeeper:7.8.0
container_name: ${ZOOKEEPER_CONTAINER_NAME:-zookeeper}
ports:
- ${ZOOKEEPER_PORT:-2181}:2181
@@ -104,7 +104,7 @@ services:
ZOOKEEPER_CLIENT_PORT: 2181
kafka:
- image: confluentinc/cp-kafka:6.2.1
+ image: confluentinc/cp-kafka:7.8.0
container_name: ${KAFKA_CONTAINER_NAME:-kafka}
ports:
- ${KAFKA_PORT:-9092}:9092
@@ -151,7 +151,7 @@ services:
KAFKA_BOOTSTRAP_SERVER: kafka:29092
NCMP_CONSUMER_GROUP_ID: ncmp-group
NCMP_ASYNC_M2M_TOPIC: ncmp-async-m2m
- MODULE_INITIAL_PROCESSING_DELAY_MS: 120000
+ MODULE_INITIAL_PROCESSING_DELAY_MS: 180000
MODULE_REFERENCES_DELAY_MS: 100
MODULE_RESOURCES_DELAY_MS: 1000
READ_DATA_FOR_CM_HANDLE_DELAY_MS: 300
@@ -203,6 +203,7 @@ services:
- ./config/grafana/inventory-dashboard.json:/var/lib/grafana/dashboards/inventory-dashboard.json
- ./config/grafana/data-dashboard.json:/var/lib/grafana/dashboards/data-dashboard.json
- ./config/grafana/postgresql-statistics-dashboard.json:/var/lib/grafana/dashboards/postgresql-statistics-dashboard.json
+ - ./config/grafana/cps-database-pool.json:/var/lib/grafana/dashboards/cps-database-pool.json
- grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
diff --git a/docs/deployment.rst b/docs/deployment.rst
index 2af0dd0cd5..840ab8e116 100644
--- a/docs/deployment.rst
+++ b/docs/deployment.rst
@@ -22,14 +22,24 @@ set appropriately. For example, given a database with 2GB of memory, 512MB is a
CPS and NCMP Configuration
==========================
+CPU and Memory Requirements
+---------------------------
+
+The following are minimum requirements for NCMP:
+
+* For 20,000 CM-handles: 2 CPUs and 2 GB RAM per instance, with 70% heap allocation.
+* For 50,000 CM-handles: 3 CPUs and 3 GB RAM per instance, with 70% heap allocation.
+
JVM Memory Allocation
+^^^^^^^^^^^^^^^^^^^^^
-Allocating 75% of the container's memory to the JVM heap ensures efficient memory management.
-This helps the JVM make the best use of the allocated resources while leaving enough memory for other processes.
+When running with 2 GB or more memory per instance, allocating 70% of the JVM memory to the heap ensures efficient
+memory management. It is not recommended to go above 70%.
.. code-block:: yaml
- JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=75.0 -XX:MaxRAMPercentage=75.0"
+ JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
+
Load balancer configuration
===========================
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy
index e4d75aa378..d1b445f5a4 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023-2024 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* Modifications Copyright (C) 2023-2025 TechMahindra Ltd
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -27,7 +27,6 @@ import org.onap.cps.integration.base.FunctionalSpecBase
import org.onap.cps.api.parameters.FetchDescendantsOption
import org.onap.cps.api.parameters.PaginationOption
import org.onap.cps.api.exceptions.CpsPathException
-import spock.lang.Ignore
import static org.onap.cps.api.parameters.FetchDescendantsOption.DIRECT_CHILDREN_ONLY
import static org.onap.cps.api.parameters.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
@@ -57,7 +56,6 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase {
'the AND is used where result does not exist' | '//books[@lang="English" and @price=1000]' || 0 | []
}
- @Ignore // TODO will be implemented in CPS-2416
def 'Query data leaf using CPS path for #scenario.'() {
when: 'query data leaf for bookstore container'
def result = objectUnderTest.queryDataLeaf(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, cpsPath, Object.class)
@@ -70,7 +68,6 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase {
'non-existing path' | '/non-existing/@title' || 0
}
- @Ignore
def 'Query data leaf with type #leafType using CPS path.'() {
given: 'a cps path query for two books, returning only #leafName'
def cpsPath = '//books[@title="Matilda" or @title="Good Omens"]/@' + leafName
@@ -85,7 +82,6 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase {
'editions' | List.class || [[1988, 2000], [2006]]
}
- @Ignore
def 'Query data leaf using CPS path with ancestor axis.'() {
given: 'a cps path query that will return the names of the categories of two books'
def cpsPath = '//books[@title="Matilda" or @title="Good Omens"]/ancestor::categories/@name'
diff --git a/integration-test/src/test/java/org/onap/cps/integration/KafkaTestContainer.java b/integration-test/src/test/java/org/onap/cps/integration/KafkaTestContainer.java
index ff4aec4175..60c1637c5a 100644
--- a/integration-test/src/test/java/org/onap/cps/integration/KafkaTestContainer.java
+++ b/integration-test/src/test/java/org/onap/cps/integration/KafkaTestContainer.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation.
+ * Copyright (C) 2024-2025 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,8 +25,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.serialization.StringDeserializer;
-import org.testcontainers.containers.KafkaContainer;
-import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.kafka.ConfluentKafkaContainer;
/**
* The Apache Kafka test container wrapper.
@@ -35,14 +34,14 @@ import org.testcontainers.utility.DockerImageName;
* Avoid unnecessary resource and time consumption.
*/
@Slf4j
-public class KafkaTestContainer extends KafkaContainer {
+public class KafkaTestContainer extends ConfluentKafkaContainer {
- private static final String IMAGE_NAME_AND_VERSION = "registry.nordix.org/onaptest/confluentinc/cp-kafka:6.2.1";
+ private static final String IMAGE_NAME_AND_VERSION = "confluentinc/cp-kafka:7.8.0";
private static volatile KafkaTestContainer kafkaTestContainer;
private KafkaTestContainer() {
- super(DockerImageName.parse(IMAGE_NAME_AND_VERSION).asCompatibleSubstituteFor("confluentinc/cp-kafka"));
+ super(IMAGE_NAME_AND_VERSION);
}
/**
diff --git a/integration-test/src/test/resources/application.yml b/integration-test/src/test/resources/application.yml
index 30598dfb90..e213a70a59 100644
--- a/integration-test/src/test/resources/application.yml
+++ b/integration-test/src/test/resources/application.yml
@@ -102,6 +102,7 @@ app:
cm-subscription-dmi-out: ${CM_SUBSCRIPTION_DMI_OUT_TOPIC:dmi-ncmp-cm-avc-subscription}
cm-subscription-ncmp-out: ${CM_SUBSCRIPTION_NCMP_OUT_TOPIC:subscription-response}
cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
+ inventory-events-topic: ncmp-inventory-events
lcm:
events:
topic: ${LCM_EVENTS_TOPIC:ncmp-events}
@@ -189,10 +190,6 @@ ncmp:
trust-level:
dmi-availability-watchdog-ms: 30000
- modules-sync-watchdog:
- async-executor:
- parallelism-level: 2
-
model-loader:
maximum-attempt-count: 20
diff --git a/k6-tests/ncmp/common/passthrough-crud.js b/k6-tests/ncmp/common/passthrough-crud.js
index 251ddf8890..a3d48fd590 100644
--- a/k6-tests/ncmp/common/passthrough-crud.js
+++ b/k6-tests/ncmp/common/passthrough-crud.js
@@ -29,7 +29,7 @@ import {
export function passthroughRead(useAlternateId) {
const cmHandleReference = getRandomCmHandleReference(useAlternateId);
- const resourceIdentifier = 'NRCellDU/attributes/cellLocalId';
+ const resourceIdentifier = 'ManagedElement=NRNode1/GNBDUFunction=1';
const datastoreName = 'ncmp-datastore:passthrough-operational';
const includeDescendants = true;
const url = generatePassthroughUrl(cmHandleReference, datastoreName, resourceIdentifier, includeDescendants);
@@ -38,7 +38,7 @@ export function passthroughRead(useAlternateId) {
export function passthroughWrite(useAlternateId) {
const cmHandleReference = getRandomCmHandleReference(useAlternateId);
- const resourceIdentifier = 'NRCellDU/attributes/cellLocalId';
+ const resourceIdentifier = 'ManagedElement=NRNode1/GNBDUFunction=1';
const datastoreName = 'ncmp-datastore:passthrough-running';
const includeDescendants = false;
const url = generatePassthroughUrl(cmHandleReference, datastoreName, resourceIdentifier, includeDescendants);
@@ -54,7 +54,7 @@ export function legacyBatchRead(cmHandleIds) {
const payload = JSON.stringify({
"operations": [
{
- "resourceIdentifier": "NRCellDU/attributes/cellLocalId",
+ "resourceIdentifier": "ManagedElement=NRNode1/GNBDUFunction=1",
"targetIds": cmHandleIds,
"datastore": "ncmp-datastore:passthrough-operational",
"options": "(fields=NRCellDU/attributes/cellLocalId)",