Bug 753585

Summary: data not showing up auto-group/auto-cluster Summary>Measurements portlet
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: Core ServerAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: high    
Version: 4.2CC: hbrock, hrupp, spinder
Target Milestone: ---   
Target Release: RHQ 4.3.0, JON 3.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:17:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 745494    
Attachments:
Description Flags
screenshot of verification none

Description Charles Crouch 2011-11-13 16:19:13 UTC
I inventoried an EAP4.3 instance and it started being monitored and availability was green, i.e. in the Monitoring>Graphs tab I could see little green dots and a couple of graphs showing data points. However if I went to the Summary tab, the Resource:Measurements portlet said something like "No metrics available" I left everything running over night and came back the next day and the four summary metrics were showing up in the Resource:Measurements portlet. We should investigate what is happening and see if anyone else can reproduce.

IMHO as soon as a metric is being collected it should show up in the Resource:Measurements portlet. That way people can quickly see the state of their metrics and also easily click through to the Big Chart view directly from the Summary tab, instead of having to go to the Monitor>Tables tab and hit Chart Selected Metric. 

Version JON3.0.0.CR1

Comment 1 Heiko W. Rupp 2011-11-14 11:32:12 UTC
I can't reproduce this for single resources, but for resource groups.

Comment 2 Charles Crouch 2011-11-14 14:31:34 UTC
IIRC I saw this also on single resources, after enabling a new metric to be 
collected.It wouldnt show up in the portlet for a while

Comment 3 John Mazzitelli 2011-11-14 22:08:16 UTC
The problem I see is in an auto-group node. But the code doesn't know its an auto-group node and thus fails to find the group:

        final boolean isAutoCluster = isAutoCluster();
        final boolean isAutoGroup = isAutoGroup();

are both false in my case. I selected the "JBossAS Server" parent auto-group node found under my platform.

We need to be clear this summary tab we are looking at because the code is dependent on the type of group.

Once my resource got metrics, I was able to see data in the resource metric portlet.

Comment 4 John Mazzitelli 2011-11-14 22:11:05 UTC
baseViewPath is null - which explains why it doesn't know if its an autogroup or autocluster:

    private boolean isAutoGroup() {
        return ResourceGroupDetailView.AUTO_GROUP_VIEW.equals(getBaseViewPath());
    }

    private boolean isAutoCluster() {
        return ResourceGroupDetailView.AUTO_CLUSTER_VIEW.equals(getBaseViewPath());
    }

    public String getBaseViewPath() {
        return baseViewPath;
    }

Comment 5 John Mazzitelli 2011-11-14 22:13:17 UTC
So, I can't see how this EVER worked.

    protected String baseViewPath = "";

is never set that I can see. So auto-group and auto-cluster group metric portlets (as far as I can tell) have never worked.

Comment 6 John Mazzitelli 2011-11-15 21:50:43 UTC
(In reply to comment #5)
> So, I can't see how this EVER worked.
>     protected String baseViewPath = "";
> is never set that I can see. So auto-group and auto-cluster group metric
> portlets (as far as I can tell) have never worked.

BTW: this is class GroupMetricsPortlet

Comment 7 John Mazzitelli 2011-11-15 22:01:28 UTC
looks like same (bad) code pattern in GroupOperationsPortlet - so we'd need to fix that too

Comment 8 John Mazzitelli 2011-11-15 23:06:49 UTC
git commit to master: deabf9f

this is not committed to release branch yet.

to test:

1) import something that has children resources - wait for metrics to come in
2) go to a auto-group node in the left hand tree
3) execute an operation on the group (assuming the resource supports operations - if you import the RHQ Server, you can use the Hibernate Statistics auto-group)
4) see that the auto-group's metrics and operations show up in the portlets in the activity subtab
5) create a normal recursive group (you can put your platform in it).
6) in the auto-cluster nodes do the same - see if you can execute a group op and see it in the ops portlet. see if you see metrics in the metric portlet

Comment 9 Simeon Pinder 2011-11-17 00:32:00 UTC
Looks good from what I can see. It looks like that was never implemented correctly.  The fix looks clean as well as it just plain would not have worked before. This should be cherry-picked to release_jon3.x.

Comment 10 John Mazzitelli 2011-11-17 01:32:22 UTC
git commit to release_jon3.x branch: 292cf4c

Comment 11 Mike Foley 2011-11-17 16:26:17 UTC
okay ... i am almost ready to mark this verified 11/17/2011 jon 3 branch.  i am attaching an image to document the verification.  there is one little thing i am not so sure about ... on step #4 in comment #8 ... i do see operations (documented in the image), but i don't see metrics (also documented in the image).  i need to drill further into the hibernate auto-group ... and then i do see some metrics.  but not at the auto-group level.  mazz, is this correct?

Comment 12 Mike Foley 2011-11-17 16:26:51 UTC
Created attachment 534234 [details]
screenshot of verification

Comment 13 John Mazzitelli 2011-11-17 16:48:52 UTC
an easy way to think of this is - first look at the resources that make up the members of the group (in your image's case, the member resource is the child "RHQ" node, under "Hibernate Statistics"). If you have metrics for member resources (e.g. look at your "RHQ" resource's resource metrics portlet for data) you should have metrics in the parent auto-group's group portlet. If you don't have resource metrics, then obviously, the group portlet won't have any either (since the group portlet is simply an aggregation of all metrics of child members).

In your case, you probably don't have metrics yet for that RHQ resource. Since its the only member of that auto-group, the group portlet won't have anything either. Go in RHQ resource to confirm. If RHQ resource DOES have metrics, but the group portlet does not, this fix does not verify.

You can wait for metrics or you can try another auto-group to test. Go to the "Hibernate Entities" auto-group (which is in your attached image) and see if it has metrics (again, to see if you should have metrics, go to one or more of its child member resource nodes and see if they have metrics - the group portlet will aggregate those metrics, but if you have none, the group metric won't show any either).

Comment 14 Mike Foley 2011-11-17 16:51:41 UTC
i am seeing the data now

Comment 15 Mike Foley 2012-02-07 19:17:15 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE