add global constant for policy execution metric 77/126977/4
authorRashmi Pujar <rashmi.pujar1@bell.ca>
Mon, 7 Feb 2022 02:17:28 +0000 (21:17 -0500)
committerRashmi Pujar <rashmi.pujar1@bell.ca>
Mon, 7 Feb 2022 14:47:34 +0000 (09:47 -0500)
Issue-ID: POLICY-3845
Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca>
Change-Id: Ib72691a80aa56249532058dac9c9e59936254fff

utils/src/main/java/org/onap/policy/common/utils/resources/PrometheusUtils.java

index 7882d81..b6dae14 100644 (file)
@@ -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;
 
 /**
@@ -40,6 +42,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).
      */
@@ -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