-
1. Reporting Features
pilhuhn Mar 4, 2011 4:25 AM (in response to bensonfungjava)Sort of
There is currently no way to do that in the UI.
But you can do it from the command line interface:
rhqadmin@pintsize:7080$ var start = new Date() - 8* 3600 * 1000;
rhqadmin@pintsize:7080$ var end = new Date()
rhqadmin@pintsize:7080$ MeasurementDataManager.findDataForResource(10003,[10473],start,end,60)
where 10003 is the resource id and 10473 is the metric definition id. You can get this e.g. from the big chart's url:
In theory it should be possible to use the exporter to output the data to CSV, but I am currently failing at it - you may want to play around with it.
The following wiki page gives you hints about CLI usage: http://www.rhq-project.org/display/JOPR2/Running+the+RHQ+CLI
-
2. Reporting Features
lkrejci Mar 4, 2011 11:51 AM (in response to pilhuhn)1 of 1 people found this helpfulTo expand on what Heiko suggests, I was able to export the data using the exporter with commands like this:
rhqadmin@pintsize:7080$ exporter.file = 'somewhere/over/the/rainbow'
rhqadmin@pintsize:7080$ exporter.format = 'csv'
rhqadmin@pintsize:7080$ var start = new Date() - 8* 3600 * 1000;
rhqadmin@pintsize:7080$ var end = new Date()
rhqadmin@pintsize:7080$ var data = MeasurementDataManager.findDataForResource(10003,[10473],start,end,60)
rhqadmin@pintsize:7080$ exporter.write(data.get(0))
the "data.get(0)" bit is important because the findDataForResource method returns a list of lists, where each "inner" list corresponds to the index of the metric id in the provided array of metric ids ([10473])). And thus the data.get(0) contains the data for the first metric (and only) metric you asked for. The exporter cannot handle the "list of lists" in csv format.
Note that I only tried this with the latest code in RHQ master branch, so your mileage may vary depending on the RHQ version you use.