Bug 759485

Summary: Error viewing live data in the resource metric graph portlet
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: Core UIAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2CC: hrupp, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.3.0   
Hardware: All   
OS: All   
Fixed In Version: 4,3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 790076 (view as bug list) Environment:
Last Closed: 2013-08-31 06:16:12 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 752488, 790076    

Description Lukas Krejci 2011-12-02 09:00:49 EST
Description of problem:
When clicking on live data icon of the resource metric graph portlet, there's a uncaught global exception in the GUI (with no server-side counterpart).

   at Unknown.java_util_NoSuchElementException_$NoSuchElementException__Ljava_util_NoSuchElementException_2Ljava_util_NoSuchElementException_2(Unknown source:0)
   at Unknown.java_util_AbstractList$IteratorImpl_$next__Ljava_util_AbstractList$IteratorImpl_2Ljava_lang_Object_2(Unknown source:0)
   at Unknown.java_util_AbstractHashMap$EntrySetIterator_next__Ljava_lang_Object_2(Unknown source:0)
   at Unknown.java_util_AbstractMap$1$1_next__Ljava_lang_Object_2(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_resource_detail_monitoring_LiveGraphView$4$1_$onSuccess__Lorg_rhq_enterprise_gui_coregui_client_inventory_resource_detail_monitoring_LiveGraphView$4$1_2Ljava_util_Set_2V(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_inventory_resource_detail_monitoring_LiveGraphView$4$1_onSuccess__Ljava_lang_Object_2V(Unknown source:0)
   at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
   at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown source:0)
   at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown source:0)
   at Unknown.anonymous(Unknown source:0)
   at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0)
   at Unknown.anonymous(Unknown source:0)
   at Unknown.anonymous(Unknown source:0)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Add the "resource metric graph" portlet to dashboard (either global or resource specific)
2. Click on the live data icon in the top-right corner.
Actual results:
uncaught exception in the message center

Expected results:
no exceptions

Additional info:
Comment 1 Jay Shaughnessy 2011-12-02 13:32:24 EST
The problem is maybe two-fold.  The exception results from not protecting
against an empty metric value return.  I will fix this.  The second
problem is that there really shouldn't be an empty value returned.

Interestingly, Lukas was just "lucky" in that the graphing actually
seems to work for all resource types other than the one he used: CPU.
At least all the ones I tried until I asked him what he used :)

So, with the fix for problem 1 the graph does not generate an exception
but it also does not display any data.  I'll look at seeing if 
CpuComponent can be tweaked to provide something for a live data
request.  The issue is due to the fact that we already do some
complex work to generate CPU metrics.
Comment 2 Jay Shaughnessy 2011-12-02 14:02:41 EST
master commit 69e2b1d81dc42b0bfc12ee8e32b08d7b2beba38d

- Fixed the live graph code to throw out metric requests returning no values
  so we should be safe from the type of exception reported.
- Fixed CpuComponent to return valid data on a live metric request, instead
  of null, so CPU resources should now give proper live graphs.
Comment 3 Mike Foley 2011-12-12 11:53:35 EST
verified RHQ 3 master branch
Comment 4 Heiko W. Rupp 2013-08-31 06:16:12 EDT
Bulk close of old bugs in VERIFIED state.