Description of problem: Metric Collection Template screen does not show all metrics from as7 plugin Version-Release number of selected component (if applicable): 4.7 How reproducible: Always Steps to Reproduce: 1.Open the Administration > Metric Collection templates page Actual results: Some as7 plugin metrics are missing (for example all metrics from child services of the JVM service) Expected results: All metrics should appear and the user should be able to define its own values
In fact, not just the metrics are missing, the the child services themselves are missing from the tree. This is not just a problem in the metric template admin page, its all the admin pages with resource types - like Alert Definition Templates, Drift Def Templates and Ignore Resource Types.
renamed the title of this issue - i'm also not sure its isolated to just the AS7 plugin. I think this is a generic issue that could happen for any plugin.
Look at "JVM" and "webservices" types as examples where the resource type admin pages don't show any child service types but there should be.
I don't know if this has anything to do with it, but staring at the descriptor looking for anything in common with the "bad" types, I noticed in all but one type that has child services and this: <runs-inside> <parent-resource-type name="Profile" plugin="&pluginName;"/> <parent-resource-type name="JBossAS7 Standalone Server" plugin="&pluginName;"/> </runs-inside> they are "bad" (in the sense they don't show their child services in the tree). There is one that does - "CMP" - but I'm wondering if "the first one" is OK but the remaining go bad.
This isn't specific to the AS7 plugin. It just so happens the AS7 plugin has a hierarchy that exposes a bug in the GWT code. I believe the error is in: org.rhq.enterprise.gui.coregui.client.admin.templates.ResourceTypeTreeNodeBuilder.ResourceTypeTreeNodeBuilder(ListGrid, ListGrid, TreeGrid) I'm still doing some debugging, but I think the problem is in here. Note: if you look, the resource type hierarchy is fine under the "JBossAS7 Host Controller" server. Its only under the "JBossAS7 Standalone Server" type where things are missing. I think its because there are types in here with multiple parents - the type shows up under one parent, but not under the other parents.
ok, I just replicated this very easily - in fact, this also illustrates a second issue that didn't show up with the AS7 plugin types. Take the etc/samples/skeleton-plugin and change its descriptor so its types look like this: <server name="AAA" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" /> <server name="BBB" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" /> <service name="YYY" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent"> <runs-inside> <parent-resource-type name="AAA" plugin="SkeletonPlugin"/> <parent-resource-type name="BBB" plugin="SkeletonPlugin"/> </runs-inside> <service name="ZZZ" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" /> </service> This mimics what the AS7 plugin does. Deploy the skeleton plugin and look at the resource type admin pages - type AAA shows child service ZZZ (in fact, it shows two of them, which is the second problem I don't see in the AS7 types) but type BBB does not show child service ZZZ.
The main problem here is that we render the resource types as a SmartGWT Tree, but the data we have isn't really a Tree, its a Graph (with multiple parents). We need to re-implement the "Servers" UI component (the third area at the bottom of the resource type admin pages) so it renders the data as a graph, not a tree. Will need to investigate if SmartGWT has a graph ui component that we could use.
git commit to master: b335646