Bug 801167 - postgres plugin Query resource cannot obtain metric
Summary: postgres plugin Query resource cannot obtain metric
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 801186
TreeView+ depends on / blocked
 
Reported: 2012-03-07 20:05 UTC by John Mazzitelli
Modified: 2013-09-01 19:19 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 801186 (view as bug list)
Environment:
Last Closed: 2013-09-01 19:19:43 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2012-03-07 20:05:58 UTC
using the postgres Query resource type, I'm defining everything correctly, but the metric value isn't coming through.

I think its because the metric propery name is metricColumn (camel case) but hte jdbc metadata that gets returned is all the same case (metriccolumn) and when doing a case-sensitive search in a map for "metricColumn", it fails on lookup (and that's how it gets the value of the column data). This is a guess, but I think that's what is going on.

Comment 1 John Mazzitelli 2012-03-07 21:00:23 UTC
I was totally wrong in my guess of what's going on.

Turns out, the metric query should return one row, TWO columns - in this case, the first column must have the value 'metricColumn' (literally) and the second is the numeric value.

select 'metricColumn', count(id) from my_table

is one example.

I did tweek the code slightly to support the use case where you don't want to supply a metric query and I allow for the name/description to be optional. I also added some debug log messages. But the core functionality was already there and working.

So, this should be considered a doc issue more than anything. We need better docs to explain how to use this resource.

Comment 2 John Mazzitelli 2012-03-07 21:07:00 UTC
master git commit: 0910465

Comment 3 Heiko W. Rupp 2013-09-01 19:19:43 UTC
Bulk closing of BZs that have no target version set, but which are ON_QA for more than a year and thus are in production for a long time.


Note You need to log in before you can comment on or make changes to this bug.