Committed by
Gerrit Code Review
Count the Intent FAILED events.
This is work toward fixing ONOS-554 Change-Id: I6aced093c47459796d40e8bd839177c4db60d1e0
Showing
3 changed files
with
25 additions
and
1 deletions
| ... | @@ -65,6 +65,7 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -65,6 +65,7 @@ public class IntentMetrics implements IntentMetricsService, |
| 65 | private static final String COMPONENT_NAME = "Intent"; | 65 | private static final String COMPONENT_NAME = "Intent"; |
| 66 | private static final String FEATURE_SUBMITTED_NAME = "Submitted"; | 66 | private static final String FEATURE_SUBMITTED_NAME = "Submitted"; |
| 67 | private static final String FEATURE_INSTALLED_NAME = "Installed"; | 67 | private static final String FEATURE_INSTALLED_NAME = "Installed"; |
| 68 | + private static final String FEATURE_FAILED_NAME = "Failed"; | ||
| 68 | private static final String FEATURE_WITHDRAW_REQUESTED_NAME = | 69 | private static final String FEATURE_WITHDRAW_REQUESTED_NAME = |
| 69 | "WithdrawRequested"; | 70 | "WithdrawRequested"; |
| 70 | private static final String FEATURE_WITHDRAWN_NAME = "Withdrawn"; | 71 | private static final String FEATURE_WITHDRAWN_NAME = "Withdrawn"; |
| ... | @@ -72,11 +73,13 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -72,11 +73,13 @@ public class IntentMetrics implements IntentMetricsService, |
| 72 | // Event metrics: | 73 | // Event metrics: |
| 73 | // - Intent Submitted API operation | 74 | // - Intent Submitted API operation |
| 74 | // - Intent Installed operation completion | 75 | // - Intent Installed operation completion |
| 76 | + // - Intent Failed compilation or installation | ||
| 75 | // - Intent Withdraw Requested API operation | 77 | // - Intent Withdraw Requested API operation |
| 76 | // - Intent Withdrawn operation completion | 78 | // - Intent Withdrawn operation completion |
| 77 | // | 79 | // |
| 78 | private EventMetric intentSubmittedEventMetric; | 80 | private EventMetric intentSubmittedEventMetric; |
| 79 | private EventMetric intentInstalledEventMetric; | 81 | private EventMetric intentInstalledEventMetric; |
| 82 | + private EventMetric intentFailedEventMetric; | ||
| 80 | private EventMetric intentWithdrawRequestedEventMetric; | 83 | private EventMetric intentWithdrawRequestedEventMetric; |
| 81 | private EventMetric intentWithdrawnEventMetric; | 84 | private EventMetric intentWithdrawnEventMetric; |
| 82 | 85 | ||
| ... | @@ -117,6 +120,11 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -117,6 +120,11 @@ public class IntentMetrics implements IntentMetricsService, |
| 117 | } | 120 | } |
| 118 | 121 | ||
| 119 | @Override | 122 | @Override |
| 123 | + public EventMetric intentFailedEventMetric() { | ||
| 124 | + return intentFailedEventMetric; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Override | ||
| 120 | public EventMetric intentWithdrawRequestedEventMetric() { | 128 | public EventMetric intentWithdrawRequestedEventMetric() { |
| 121 | return intentWithdrawRequestedEventMetric; | 129 | return intentWithdrawRequestedEventMetric; |
| 122 | } | 130 | } |
| ... | @@ -137,7 +145,7 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -137,7 +145,7 @@ public class IntentMetrics implements IntentMetricsService, |
| 137 | intentInstalledEventMetric.eventReceived(); | 145 | intentInstalledEventMetric.eventReceived(); |
| 138 | break; | 146 | break; |
| 139 | case FAILED: | 147 | case FAILED: |
| 140 | - // ignore | 148 | + intentFailedEventMetric.eventReceived(); |
| 141 | break; | 149 | break; |
| 142 | case WITHDRAW_REQ: | 150 | case WITHDRAW_REQ: |
| 143 | intentWithdrawRequestedEventMetric.eventReceived(); | 151 | intentWithdrawRequestedEventMetric.eventReceived(); |
| ... | @@ -181,6 +189,9 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -181,6 +189,9 @@ public class IntentMetrics implements IntentMetricsService, |
| 181 | intentInstalledEventMetric = | 189 | intentInstalledEventMetric = |
| 182 | new EventMetric(metricsService, COMPONENT_NAME, | 190 | new EventMetric(metricsService, COMPONENT_NAME, |
| 183 | FEATURE_INSTALLED_NAME); | 191 | FEATURE_INSTALLED_NAME); |
| 192 | + intentFailedEventMetric = | ||
| 193 | + new EventMetric(metricsService, COMPONENT_NAME, | ||
| 194 | + FEATURE_FAILED_NAME); | ||
| 184 | intentWithdrawRequestedEventMetric = | 195 | intentWithdrawRequestedEventMetric = |
| 185 | new EventMetric(metricsService, COMPONENT_NAME, | 196 | new EventMetric(metricsService, COMPONENT_NAME, |
| 186 | FEATURE_WITHDRAW_REQUESTED_NAME); | 197 | FEATURE_WITHDRAW_REQUESTED_NAME); |
| ... | @@ -190,6 +201,7 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -190,6 +201,7 @@ public class IntentMetrics implements IntentMetricsService, |
| 190 | 201 | ||
| 191 | intentSubmittedEventMetric.registerMetrics(); | 202 | intentSubmittedEventMetric.registerMetrics(); |
| 192 | intentInstalledEventMetric.registerMetrics(); | 203 | intentInstalledEventMetric.registerMetrics(); |
| 204 | + intentFailedEventMetric.registerMetrics(); | ||
| 193 | intentWithdrawRequestedEventMetric.registerMetrics(); | 205 | intentWithdrawRequestedEventMetric.registerMetrics(); |
| 194 | intentWithdrawnEventMetric.registerMetrics(); | 206 | intentWithdrawnEventMetric.registerMetrics(); |
| 195 | } | 207 | } |
| ... | @@ -200,6 +212,7 @@ public class IntentMetrics implements IntentMetricsService, | ... | @@ -200,6 +212,7 @@ public class IntentMetrics implements IntentMetricsService, |
| 200 | private void removeMetrics() { | 212 | private void removeMetrics() { |
| 201 | intentSubmittedEventMetric.removeMetrics(); | 213 | intentSubmittedEventMetric.removeMetrics(); |
| 202 | intentInstalledEventMetric.removeMetrics(); | 214 | intentInstalledEventMetric.removeMetrics(); |
| 215 | + intentFailedEventMetric.removeMetrics(); | ||
| 203 | intentWithdrawRequestedEventMetric.removeMetrics(); | 216 | intentWithdrawRequestedEventMetric.removeMetrics(); |
| 204 | intentWithdrawnEventMetric.removeMetrics(); | 217 | intentWithdrawnEventMetric.removeMetrics(); |
| 205 | } | 218 | } | ... | ... |
| ... | @@ -45,6 +45,13 @@ public interface IntentMetricsService { | ... | @@ -45,6 +45,13 @@ public interface IntentMetricsService { |
| 45 | public EventMetric intentInstalledEventMetric(); | 45 | public EventMetric intentInstalledEventMetric(); |
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | + * Gets the Event Metric for the intent FAILED events. | ||
| 49 | + * | ||
| 50 | + * @return the Event Metric for the intent FAILED events. | ||
| 51 | + */ | ||
| 52 | + public EventMetric intentFailedEventMetric(); | ||
| 53 | + | ||
| 54 | + /** | ||
| 48 | * Gets the Event Metric for the intent WITHDRAW_REQ events. | 55 | * Gets the Event Metric for the intent WITHDRAW_REQ events. |
| 49 | * | 56 | * |
| 50 | * @return the Event Metric for the intent WITHDRAW_REQ events. | 57 | * @return the Event Metric for the intent WITHDRAW_REQ events. | ... | ... |
apps/metrics/intent/src/main/java/org/onosproject/metrics/intent/cli/IntentEventsMetricsCommand.java
| ... | @@ -56,6 +56,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { | ... | @@ -56,6 +56,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { |
| 56 | service.intentSubmittedEventMetric()); | 56 | service.intentSubmittedEventMetric()); |
| 57 | result = json(mapper, result, "intentInstalled", | 57 | result = json(mapper, result, "intentInstalled", |
| 58 | service.intentInstalledEventMetric()); | 58 | service.intentInstalledEventMetric()); |
| 59 | + result = json(mapper, result, "intentFailed", | ||
| 60 | + service.intentFailedEventMetric()); | ||
| 59 | result = json(mapper, result, "intentWithdrawRequested", | 61 | result = json(mapper, result, "intentWithdrawRequested", |
| 60 | service.intentWithdrawRequestedEventMetric()); | 62 | service.intentWithdrawRequestedEventMetric()); |
| 61 | result = json(mapper, result, "intentWithdrawn", | 63 | result = json(mapper, result, "intentWithdrawn", |
| ... | @@ -66,6 +68,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { | ... | @@ -66,6 +68,8 @@ public class IntentEventsMetricsCommand extends AbstractShellCommand { |
| 66 | service.intentSubmittedEventMetric()); | 68 | service.intentSubmittedEventMetric()); |
| 67 | printEventMetric("Installed", | 69 | printEventMetric("Installed", |
| 68 | service.intentInstalledEventMetric()); | 70 | service.intentInstalledEventMetric()); |
| 71 | + printEventMetric("Failed", | ||
| 72 | + service.intentFailedEventMetric()); | ||
| 69 | printEventMetric("Withdraw Requested", | 73 | printEventMetric("Withdraw Requested", |
| 70 | service.intentWithdrawRequestedEventMetric()); | 74 | service.intentWithdrawRequestedEventMetric()); |
| 71 | printEventMetric("Withdrawn", | 75 | printEventMetric("Withdrawn", | ... | ... |
-
Please register or login to post a comment