summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-management/src/main/java')
-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