diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2021-02-18 16:50:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-18 16:50:06 +0000 |
commit | dd8c5ad785a19c3af7249808aa01fe4f04abc61e (patch) | |
tree | 1c0cba871bf020182b798c2e304492be475087b9 /policy-management/src | |
parent | 266687dd55e2971ed7714faf27055848963ba499 (diff) | |
parent | cd1d0fb2229af043c36f8225d6e5d8a8e8fe78dd (diff) |
Merge "deploy stats in lifecycle module"
Diffstat (limited to 'policy-management/src')
-rw-r--r-- | policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java | 9 |
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()) { |