summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-02-16 18:09:46 -0600
committerjhh <jorge.hernandez-herrero@att.com>2021-02-18 08:51:11 -0600
commitcd1d0fb2229af043c36f8225d6e5d8a8e8fe78dd (patch)
tree2353a03baeb94d3ae4e17292e720b20494849842 /policy-management/src/main/java
parent65c7d3a4dcd2841c5fafab6e7b8d310e5ec1cb6c (diff)
deploy stats in lifecycle module
Issue-ID: POLICY-3033 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaa78aa48064e8288265aeb498279e9d8324538d8 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-management/src/main/java')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java b/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java
index d6d8d500..add4c18c 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java
@@ -23,10 +23,12 @@ package org.onap.policy.drools.stats;
import static org.slf4j.LoggerFactory.getLogger;
import java.time.Instant;
-import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
+import lombok.Setter;
+import lombok.Synchronized;
import lombok.ToString;
import org.onap.policy.drools.metrics.TransMetric;
import org.slf4j.Logger;
@@ -35,7 +37,8 @@ import org.slf4j.Logger;
* Basic policy execution statistics.
*/
-@Data
+@Setter(onMethod_ = @Synchronized)
+@Getter(onMethod_ = @Synchronized)
@NoArgsConstructor
@EqualsAndHashCode
@ToString
@@ -86,6 +89,8 @@ public class PolicyStats {
/**
* add a stat transaction record.
*/
+
+ @Synchronized
public void stat(@NonNull TransMetric trans) {
policyExecutedCount++;
if (trans.isSuccess()) {