Bug fixes for APEX PDP metrics 34/128234/2
authorRashmi Pujar <rashmi.pujar1@bell.ca>
Thu, 31 Mar 2022 15:52:53 +0000 (11:52 -0400)
committerRashmi Pujar <rashmi.pujar1@bell.ca>
Thu, 31 Mar 2022 16:45:23 +0000 (12:45 -0400)
commitd2be27372c1e3efb76e2edd648bcfab8945ea51f
treed137d765090e11de35dd32972b499718bc9f0fec
parent6c3a6abb7e18be81284866f61a54557474e643ed
Bug fixes for APEX PDP metrics

1. APEX engine metrics were being initialized to 0 in the
constructor which caused them to reset to 0. Hence, initialization
is removed, and updates are done to metrics only upon:
engineStart/Stop, executionEnter/Exit stages.
2. APEX engine Uptime was only updated when engine stopped,
hence always 0. Also, uptime is redundant since it can be derived
from lastStart timestamp and hence is removed as a metric.
3. Fixed a corner case bug which occurs when all
policies are undeployed the counters are not correct.
4. Fix Unit tests

Issue-ID: POLICY-4044
Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca>
Change-Id: I4d875ff288cf8c242a1851eb105e56dc69b97883
model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java
model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java