From c05015ae25604825d9a1d951e3a2d0981b955eae Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Mon, 7 Aug 2023 16:01:21 -0400 Subject: Remove db based statistics from drools-pdp Removing the db based statistics from xacml-pdp, in favour of the prometheus based option. Issue-ID: POLICY-4109 Change-Id: I0bc7dbe55f13881fb792bd485cecff1dfc898dc0 Signed-off-by: Ram Krishna Verma --- .../onap/policy/drools/lifecycle/LifecycleFsm.java | 1 - .../policy/drools/lifecycle/LifecycleFsmTest.java | 25 ---------------------- 2 files changed, 26 deletions(-) diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java index b09d2563..4ded8dc9 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java @@ -668,7 +668,6 @@ public class LifecycleFsm implements Startable { status.setHealthy(isAlive() ? PdpHealthStatus.HEALTHY : PdpHealthStatus.NOT_HEALTHY); status.setPdpType(getPdpType()); status.setPolicies(new ArrayList<>(policiesMap.keySet())); - status.setStatistics(statisticsPayload()); return status; } diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java index 8c3aeef1..ff8b1042 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java @@ -22,7 +22,6 @@ package org.onap.policy.drools.lifecycle; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import java.io.IOException; import java.nio.file.Files; @@ -44,8 +43,6 @@ import org.onap.policy.common.utils.time.PseudoScheduledExecutorService; import org.onap.policy.common.utils.time.TestTimeMulti; import org.onap.policy.drools.persistence.SystemPersistenceConstants; import org.onap.policy.drools.system.PolicyEngineConstants; -import org.onap.policy.models.pdp.concepts.PdpStatus; -import org.onap.policy.models.pdp.enums.PdpState; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; @@ -233,28 +230,6 @@ public class LifecycleFsmTest { assertEquals(0, fsm.getStats().getPolicyDeployCount()); } - @Test - public void testStatusPayload() { - setExecutionCounts(); - fsm.updateDeployCountsAction(8L, 6L, 2L); - fsm.updateUndeployCountsAction(4L, 3L, 1L); - PdpStatus status = fsm.statusPayload(PdpState.ACTIVE); - - assertEquals(fsm.getGroup(), status.getStatistics().getPdpGroupName()); - assertEquals(fsm.getSubGroup(), status.getStatistics().getPdpSubGroupName()); - assertEquals(PolicyEngineConstants.getManager().getPdpName(), status.getStatistics().getPdpInstanceId()); - assertEquals(6, status.getStatistics().getPolicyDeploySuccessCount()); - assertEquals(2, status.getStatistics().getPolicyDeployFailCount()); - assertEquals(8, status.getStatistics().getPolicyDeployCount()); - assertNotNull(status.getStatistics().getTimeStamp()); - assertEquals(7, status.getStatistics().getPolicyExecutedCount()); - assertEquals(2, status.getStatistics().getPolicyExecutedFailCount()); - assertEquals(5, status.getStatistics().getPolicyExecutedSuccessCount()); - assertEquals(3, status.getStatistics().getPolicyUndeploySuccessCount()); - assertEquals(1, status.getStatistics().getPolicyUndeployFailCount()); - assertEquals(4, status.getStatistics().getPolicyUndeployCount()); - } - @Test public void testMergePolicies() { assertEquals(List.of(), fsm.getActivePolicies()); -- cgit 1.2.3-korg