Sonar Critical Fix
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-common / src / main / java / org / openecomp / dcae / apod / analytics / cdap / common / CDAPMetricsConstants.java
1 /*\r
2  * ===============================LICENSE_START======================================\r
3  *  dcae-analytics\r
4  * ================================================================================\r
5  *    Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  *  Licensed under the Apache License, Version 2.0 (the "License");\r
8  *  you may not use this file except in compliance with the License.\r
9  *   You may obtain a copy of the License at\r
10  *\r
11  *          http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  *  Unless required by applicable law or agreed to in writing, software\r
14  *  distributed under the License is distributed on an "AS IS" BASIS,\r
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  *  See the License for the specific language governing permissions and\r
17  *  limitations under the License.\r
18  *  ============================LICENSE_END===========================================\r
19  */\r
20 \r
21 package org.openecomp.dcae.apod.analytics.cdap.common;\r
22 \r
23 /**\r
24  * Contains all metrics names used for DCAE CDAP modules\r
25  *\r
26  * <p>\r
27  *     Format should be (ModuleName)_(Description of metrics)_METRIC e.g. TCA_WORKER_FAILED_ATTEMPTS_METRIC\r
28  * </p>\r
29  *\r
30  * @author Rajiv Singla . Creation Date: 10/25/2016.\r
31  */\r
32 public abstract class CDAPMetricsConstants {\r
33 \r
34     /**\r
35      * Metric captures count of all responses received from DMaaP MR Subscriber Topic\r
36      */\r
37     public static final String DMAAP_MR_SUBSCRIBER_ALL_RESPONSES_COUNT_METRIC =\r
38             "dmaap.subscriber.fetch.all_responses";\r
39 \r
40     /**\r
41      * Metric captures count of responses from DMaaP MR Subscriber Topic which does not have 200 HTTP Response code.\r
42      * This can be due to DMaaP topic being down or any internal server errors etc.\r
43      */\r
44     public static final String DMAAP_MR_SUBSCRIBER_UNSUCCESSFUL_RESPONSES_METRIC =\r
45             "dmaap.subscriber.fetch.unsuccessful";\r
46 \r
47     /**\r
48      * Metric that counts the number of successful (200 HTTP Response Code) calls to DMaaP which did not had empty\r
49      * messages\r
50      */\r
51     public static final String DMAAP_MR_SUBSCRIBER_RESPONSES_WITH_NO_MESSAGES_METRIC =\r
52             "dmaap.subscriber.fetch.no_message";\r
53 \r
54     /**\r
55      * Metric to count total number of message processed by DMaaP MR subscriber\r
56      */\r
57     public static final String DMAAP_MR_SUBSCRIBER_TOTAL_MESSAGES_PROCESSED_METRIC = "dmaap.subscriber.message.count";\r
58 \r
59 \r
60     /**\r
61      * Metric to record time taken in ms by subscriber in its most recent call to fetch DMaaP MR messages\r
62      */\r
63     public static final String DMAAP_MR_SUBSCRIBER_RESPONSE_TIME_MS_METRIC = "dmaap.subscriber.fetch.response_time";\r
64 \r
65     /**\r
66      * Metric captures the count of number of times DMaaP MR Subscriber was unable to write to DMaaP Stream due\r
67      * some CDAP error while writing to stream. This should ideally never happen assuming we have enough space\r
68      * on CDAP machine and CDAP process is functioning normally\r
69      */\r
70     public static final String TCA_SUBSCRIBER_FAILURE_TO_WRITE_TO_STREAM_METRIC = "tca.subscriber.stream.writing.error";\r
71 \r
72 \r
73     /**\r
74      * Metric captures number of VES messages that are not applicable as per TCA Policy\r
75      */\r
76     public static final String TCA_VES_INAPPLICABLE_MESSAGES_METRIC = "tca.ves.calculator.inapplicable";\r
77 \r
78     /**\r
79      * Metric captures number of VES messages that are applicable as per TCA Policy but don't violate any thresholds\r
80      */\r
81     public static final String TCA_VES_COMPLIANT_MESSAGES_METRIC = "tca.ves.calculator.compliant";\r
82 \r
83     /**\r
84      * Metrics captures number of VES messages that are applicable as per TCA Policy and does violate thresholds and\r
85      * will likely cause an alert\r
86      */\r
87     public static final String TCA_VES_NON_COMPLIANT_MESSAGES_METRIC = "tca.ves.calculator.non_compliant";\r
88 \r
89 \r
90     /**\r
91      * Metric that counts the number of publisher look ups in alerts table which resulted in 0 new alerts\r
92      */\r
93     public static final String TCA_PUBLISHER_NO_NEW_ALERTS_LOOKUP_METRIC = "tca.publisher.lookup.no_message";\r
94 \r
95     /**\r
96      * Metric that counts the number of new alerts found by the publisher in alerts table\r
97      */\r
98     public static final String TCA_PUBLISHER_NEW_ALERTS_METRIC = "tca.publisher.lookup.new_messages";\r
99 \r
100     /**\r
101      * Metric that counts the number of alerts deleted by publisher in alerts table\r
102      */\r
103     public static final String TCA_PUBLISHER_DELETED_ALERTS_METRIC = "tca.publisher.deleted.alerts";\r
104 \r
105     /**\r
106      * Metric that counts the number of publisher calls to DMaaP which resulted in successful response code\r
107      */\r
108     public static final String TCA_PUBLISHER_SUCCESSFUL_DMAAP_RESPONSE_METRIC = "tca.publisher.publish.successful";\r
109 \r
110     /**\r
111      * Metric that counts the number of publisher calls to DMaaP which resulted in unsuccessful response code\r
112      */\r
113     public static final String TCA_PUBLISHER_UNSUCCESSFUL_DMAAP_RESPONSE_METRIC = "tca.publisher.publish.unsuccessful";\r
114 \r
115     private CDAPMetricsConstants() {\r
116 \r
117     }\r
118 \r
119 }\r