summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org/onap
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-02-18 13:32:16 -0600
committerjhh <jorge.hernandez-herrero@att.com>2021-02-19 08:24:29 -0600
commitd6083133bac5c1a54681a004468d416993d47d7f (patch)
treee99be71f5346b634150eebd2875f4f79b640a988 /policy-management/src/main/java/org/onap
parentdd8c5ad785a19c3af7249808aa01fe4f04abc61e (diff)
remove TransMetric - not needed
Issue-ID: POLICY-3033 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I626de45b528bb891c79900085bfe783fe248b3fa Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-management/src/main/java/org/onap')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStats.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStatsManager.java4
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java3
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java13
4 files changed, 12 insertions, 12 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 add4c18c..03ab2268 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
@@ -30,7 +30,7 @@ import lombok.NonNull;
import lombok.Setter;
import lombok.Synchronized;
import lombok.ToString;
-import org.onap.policy.drools.metrics.TransMetric;
+import org.onap.policy.drools.metrics.Metric;
import org.slf4j.Logger;
/**
@@ -91,7 +91,7 @@ public class PolicyStats {
*/
@Synchronized
- public void stat(@NonNull TransMetric trans) {
+ public void stat(@NonNull Metric trans) {
policyExecutedCount++;
if (trans.isSuccess()) {
policyExecutedSuccessCount++;
diff --git a/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStatsManager.java b/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStatsManager.java
index bb1b2679..c8066484 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStatsManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/stats/PolicyStatsManager.java
@@ -27,7 +27,7 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;
-import org.onap.policy.drools.metrics.TransMetric;
+import org.onap.policy.drools.metrics.Metric;
/**
* Policy Stats Manager that manages PDP-D statistics.
@@ -45,7 +45,7 @@ public class PolicyStatsManager {
/**
* stat a new transaction.
*/
- public synchronized void stat(@NonNull String subGroupName, @NonNull TransMetric transaction) {
+ public synchronized void stat(@NonNull String subGroupName, @NonNull Metric transaction) {
groupStat.stat(transaction);
subgroupStats.computeIfAbsent(subGroupName, key -> new PolicyStats()).stat(transaction);
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
index ef641f31..10623c50 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
@@ -34,7 +34,6 @@ import org.onap.policy.drools.core.lock.Lock;
import org.onap.policy.drools.core.lock.LockCallback;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.metrics.Metric;
-import org.onap.policy.drools.metrics.TransMetric;
import org.onap.policy.drools.policies.DomainMaker;
import org.onap.policy.drools.protocol.configuration.ControllerConfiguration;
import org.onap.policy.drools.protocol.configuration.PdpdConfiguration;
@@ -362,5 +361,5 @@ public interface PolicyEngine extends Startable, Lockable, TopicListener {
* @param policyName policy name
* @param transaction transaction
*/
- void transaction(String controllerName, String policyName, TransMetric transaction);
+ void transaction(String controllerName, String policyName, Metric transaction);
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
index e20986cb..1b2c13a1 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngineManager.java
@@ -68,7 +68,6 @@ import org.onap.policy.drools.features.PolicyControllerFeatureApiConstants;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApiConstants;
import org.onap.policy.drools.metrics.Metric;
-import org.onap.policy.drools.metrics.TransMetric;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.drools.policies.DomainMaker;
@@ -255,13 +254,15 @@ class PolicyEngineManager implements PolicyEngine {
}
@Override
- public void transaction(@NonNull String controllerName,
- @NonNull String policyName, @NonNull TransMetric transaction) {
+ public void transaction(@NonNull String controllerName, // NOSONAR placeholder
+ @NonNull String controlLoopName, @NonNull Metric transaction) {
- // will stat on a per policy name that for an admin would
- // be more significant than a controller name.
+ // keeping stats on a per control loop name,
+ // applications must report the controller name too
+ // for completeness and to avoid being modified when/if
+ // the controller name is used for tracking purposes
- getStats().stat(controllerName + "[" + policyName + "]", transaction);
+ getStats().stat(controlLoopName, transaction);
}
@Override