From 916347f202c640a1694e10784d9fe6428b024afb Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Tue, 6 Jul 2021 16:49:41 +0100 Subject: Update pdp statistics to count deploy/undeploy separately. Issue-ID: POLICY-3383 Change-Id: Iec7875fb1fa6a4a360b8cfdff0b80f697a289de3 Signed-off-by: adheli.tavares --- .../java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java | 3 +++ .../java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java | 2 ++ 2 files changed, 5 insertions(+) (limited to 'main/src') diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java b/main/src/main/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java index 45febe95..4ffbe622 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java @@ -349,6 +349,9 @@ public class PdpStatusMessageHandler extends PdpMessageGenerator { .append(message.getStatistics().getPolicyDeployCount() < 0, false) .append(message.getStatistics().getPolicyDeployFailCount() < 0, false) .append(message.getStatistics().getPolicyDeploySuccessCount() < 0, false) + .append(message.getStatistics().getPolicyUndeployCount() < 0, false) + .append(message.getStatistics().getPolicyUndeployFailCount() < 0, false) + .append(message.getStatistics().getPolicyUndeploySuccessCount() < 0, false) .append(message.getStatistics().getPolicyExecutedCount() < 0, false) .append(message.getStatistics().getPolicyExecutedFailCount() < 0, false) .append(message.getStatistics().getPolicyExecutedSuccessCount() < 0, false).build(); diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java index 2344c4f3..7ae4b370 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java @@ -342,6 +342,8 @@ public class PdpHeartbeatListenerTest extends End2EndBase { pdpStatistics06.setPolicyDeployCount(-1); pdpStatistics06.setPolicyDeployFailCount(-1); + pdpStatistics06.setPolicyUndeployCount(-1); + pdpStatistics06.setPolicyUndeployFailCount(-1); status5.setStatistics(pdpStatistics06); pdpHeartbeatListener.onTopicEvent(INFRA, TOPIC, status5); -- cgit 1.2.3-korg