Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-570

NullPointerException when Metrics not populated for a Service

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 1.1.6.Final, 1.1.x
    • 1.1.4.Final
    • None
    • None
    • Hide

      Using 1.1.4.Final, create a public service, before accessing the endpoint, click the Metrics tab, a NullPointerException is thrown. I believe the same happens when the ES server is down, but not sure about this one.

      Show
      Using 1.1.4.Final, create a public service, before accessing the endpoint, click the Metrics tab, a NullPointerException is thrown. I believe the same happens when the ES server is down, but not sure about this one.

    Description

      When a service does not have metrics yet, an exception is thrown in the following snippet:

      DateHistogramAggregation aggregation = aggregations.getDateHistogramAggregation("histogram");
      List<DateHistogram> buckets = aggregation.getBuckets();
      

      Need to check for null before getting the buckets

      Attachments

        Activity

          People

            ewittman@redhat.com Eric Wittmann
            mahom1985_jira Mahmood Omari (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: