summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorRashmi Pujar <rashmi.pujar1@bell.ca>2022-02-06 21:17:28 -0500
committerRashmi Pujar <rashmi.pujar1@bell.ca>2022-02-07 09:47:34 -0500
commitc341937e0c058304a5a808e4bf416b651d817032 (patch)
treead172060b09bd9fe2e3f5555bf93204287f952bb /utils
parent56a1d2bf3c2154e2b92681f8c3ae55ac082b6dba (diff)
add global constant for policy execution metric
Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: Ib72691a80aa56249532058dac9c9e59936254fff
Diffstat (limited to 'utils')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java b/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java
index 7882d81a..b6dae149 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +22,7 @@
package org.onap.policy.common.utils.resources;
import lombok.AccessLevel;
+import lombok.Getter;
import lombok.NoArgsConstructor;
/**
@@ -41,6 +43,16 @@ public class PrometheusUtils {
public static final String POLICY_DEPLOYMENT_HELP = "The total number of policy deployments.";
/**
+ * Policy Execution Metric Name.
+ */
+ public static final String POLICY_EXECUTION_METRIC = "policy_executions";
+
+ /**
+ * Policy Execution Metric Help Message.
+ */
+ public static final String POLICY_EXECUTION_HELP = "The total number of TOSCA policy executions.";
+
+ /**
* Metric label for arbitrary operations (eg. deploy, undeploy, execute).
*/
public static final String OPERATION_METRIC_LABEL = "operation";
@@ -65,4 +77,19 @@ public class PrometheusUtils {
*/
public static final String STATUS_METRIC_LABEL = "status";
-}
+ /**
+ * Prometheus namespace values mapping to the supported PDP types.
+ */
+ public enum PdpType {
+ PDPD("pdpd"),
+ PDPA("pdpa"),
+ PDPX("pdpx");
+
+ @Getter
+ private final String namespace;
+
+ PdpType(String namespace) {
+ this.namespace = namespace;
+ }
+ }
+} \ No newline at end of file