aboutsummaryrefslogtreecommitdiffstats
path: root/models-pdp/src/main/java/org/onap
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2021-07-05 14:59:40 +0100
committeradheli.tavares <adheli.tavares@est.tech>2021-07-07 13:07:40 +0100
commit43ed6b71f24a06834ee9fd6f7ceb28eda2c351ba (patch)
treea5418aee5608702ad02f900f33442ebb624abe7d /models-pdp/src/main/java/org/onap
parentd6d78efe6a355805ad384ded50e2a25e31e7345a (diff)
Update pdp statistics to count deploy/undeploy separately.
Issue-ID: POLICY-3383 Change-Id: I41e2668bdebd732149db0ccbe160b67b9952a8d9 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'models-pdp/src/main/java/org/onap')
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java18
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpStatistics.java24
2 files changed, 34 insertions, 8 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
index c9c4cda0e..13b3bdc33 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatistics.java
@@ -43,12 +43,15 @@ public class PdpStatistics {
private Long generatedId;
private String pdpGroupName;
private String pdpSubGroupName;
- private long policyDeployCount;
- private long policyDeploySuccessCount;
- private long policyDeployFailCount;
private long policyExecutedCount;
private long policyExecutedSuccessCount;
private long policyExecutedFailCount;
+ private long policyDeployCount;
+ private long policyDeploySuccessCount;
+ private long policyDeployFailCount;
+ private long policyUndeployCount;
+ private long policyUndeploySuccessCount;
+ private long policyUndeployFailCount;
private List<PdpEngineWorkerStatistics> engineStats;
/**
@@ -62,12 +65,15 @@ public class PdpStatistics {
this.generatedId = source.generatedId;
this.pdpGroupName = source.pdpGroupName;
this.pdpSubGroupName = source.pdpSubGroupName;
- this.policyDeployCount = source.policyDeployCount;
- this.policyDeployFailCount = source.policyDeployFailCount;
- this.policyDeploySuccessCount = source.policyDeploySuccessCount;
this.policyExecutedCount = source.policyExecutedCount;
this.policyExecutedFailCount = source.policyExecutedFailCount;
this.policyExecutedSuccessCount = source.policyExecutedSuccessCount;
+ this.policyDeployCount = source.policyDeployCount;
+ this.policyDeployFailCount = source.policyDeployFailCount;
+ this.policyDeploySuccessCount = source.policyDeploySuccessCount;
+ this.policyUndeployCount = source.policyUndeployCount;
+ this.policyUndeployFailCount = source.policyUndeployFailCount;
+ this.policyUndeploySuccessCount = source.policyUndeploySuccessCount;
this.engineStats = PfUtils.mapList(source.engineStats, PdpEngineWorkerStatistics::new, null);
}
}
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpStatistics.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpStatistics.java
index a62eaa304..0ff60b90f 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpStatistics.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpStatistics.java
@@ -66,7 +66,6 @@ import org.onap.policy.models.pdp.concepts.PdpStatistics;
@EqualsAndHashCode(callSuper = false)
public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStatistics>, Serializable {
private static final long serialVersionUID = -7312974966820980659L;
- private static final String NULL_NAME = "NULL";
@EmbeddedId
@VerifyKey
@@ -101,6 +100,15 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
@Column
private long policyExecutedFailCount;
+ @Column
+ private long policyUndeployCount;
+
+ @Column
+ private long policyUndeploySuccessCount;
+
+ @Column
+ private long policyUndeployFailCount;
+
@ElementCollection
private List<PdpEngineWorkerStatistics> engineStats;
@@ -117,7 +125,7 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
* @param key the key
*/
public JpaPdpStatistics(@NonNull final PfGeneratedIdKey key) {
- this(key, null, NULL_NAME, NULL_NAME, 0L, 0L, 0L, 0L, 0L, 0L, null);
+ this.key = new PfGeneratedIdKey(key);
}
/**
@@ -134,6 +142,9 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
this.policyDeployCount = copyConcept.policyDeployCount;
this.policyDeploySuccessCount = copyConcept.policyDeploySuccessCount;
this.policyDeployFailCount = copyConcept.policyDeployFailCount;
+ this.policyUndeployCount = copyConcept.policyUndeployCount;
+ this.policyUndeploySuccessCount = copyConcept.policyUndeploySuccessCount;
+ this.policyUndeployFailCount = copyConcept.policyUndeployFailCount;
this.policyExecutedCount = copyConcept.policyExecutedCount;
this.policyExecutedSuccessCount = copyConcept.policyExecutedSuccessCount;
this.policyExecutedFailCount = copyConcept.policyExecutedFailCount;
@@ -170,6 +181,9 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
.append(this.policyDeployCount, other.policyDeployCount)
.append(this.policyDeployFailCount, other.policyDeployFailCount)
.append(this.policyDeploySuccessCount, other.policyDeploySuccessCount)
+ .append(this.policyUndeployCount, other.policyUndeployCount)
+ .append(this.policyUndeployFailCount, other.policyUndeployFailCount)
+ .append(this.policyUndeploySuccessCount, other.policyUndeploySuccessCount)
.append(this.policyExecutedCount, other.policyExecutedCount)
.append(this.policyExecutedFailCount, other.policyExecutedFailCount)
.append(this.policyExecutedSuccessCount, other.policyExecutedSuccessCount).toComparison();
@@ -186,6 +200,9 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
pdpStatistics.setPolicyDeployCount(policyDeployCount);
pdpStatistics.setPolicyDeployFailCount(policyDeployFailCount);
pdpStatistics.setPolicyDeploySuccessCount(policyDeploySuccessCount);
+ pdpStatistics.setPolicyUndeployCount(policyUndeployCount);
+ pdpStatistics.setPolicyUndeployFailCount(policyUndeployFailCount);
+ pdpStatistics.setPolicyUndeploySuccessCount(policyUndeploySuccessCount);
pdpStatistics.setPolicyExecutedCount(policyExecutedCount);
pdpStatistics.setPolicyExecutedFailCount(policyExecutedFailCount);
pdpStatistics.setPolicyExecutedSuccessCount(policyExecutedSuccessCount);
@@ -212,6 +229,9 @@ public class JpaPdpStatistics extends PfConcept implements PfAuthorative<PdpStat
this.setPolicyDeployCount(pdpStatistics.getPolicyDeployCount());
this.setPolicyDeployFailCount(pdpStatistics.getPolicyDeployFailCount());
this.setPolicyDeploySuccessCount(pdpStatistics.getPolicyDeploySuccessCount());
+ this.setPolicyUndeployCount(pdpStatistics.getPolicyUndeployCount());
+ this.setPolicyUndeployFailCount(pdpStatistics.getPolicyUndeployFailCount());
+ this.setPolicyUndeploySuccessCount(pdpStatistics.getPolicyUndeploySuccessCount());
this.setPolicyExecutedCount(pdpStatistics.getPolicyExecutedCount());
this.setPolicyExecutedFailCount(pdpStatistics.getPolicyExecutedFailCount());
this.setPolicyExecutedSuccessCount(pdpStatistics.getPolicyExecutedSuccessCount());