summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2023-08-07 16:01:21 -0400
committerRam Krishna Verma <ram_krishna.verma@bell.ca>2023-08-07 16:01:26 -0400
commitc05015ae25604825d9a1d951e3a2d0981b955eae (patch)
tree69ef0a127b7801c2a2a0bd9c653ec7991e0ff327
parentfe600f6935b5260a7f15c3e6f4a3b821605897e2 (diff)
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 <ram_krishna.verma@bell.ca>
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java1
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java25
2 files changed, 0 insertions, 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;
@@ -234,28 +231,6 @@ public class LifecycleFsmTest {
}
@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());
assertEquals(List.of(), fsm.mergePolicies(List.of(), List.of()));