Bug 865950 - Expose method to set timestamp on MeasurementDataNumeric
Summary: Expose method to set timestamp on MeasurementDataNumeric
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Simeon Pinder
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-12 21:29 UTC by Elias Ross
Modified: 2013-07-01 16:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-01 16:36:37 UTC
Embargoed:


Attachments (Terms of Use)
simple patch for this feature (4.62 KB, patch)
2012-10-12 21:31 UTC, Elias Ross
no flags Details | Diff

Description Elias Ross 2012-10-12 21:29:00 UTC
I am gathering data from a reporting system for metrics that are in the past:

The query is basically:

select time_stamp, value1, value2
from report
order by time_stamp desc

So I'd like this data to be added to the RHQ database with this timestamp, not the current time.

Unfortunately MeasurementData has no (easy) way to set the timestamp value.

There's also the problem of potentially returning duplicate values. It would be preferable if RHQ would ignore duplicates on insert... The work around I have is to simply have the plugin check that it reported this duplicate timestamp or not.

Here is a patch to do so.

Comment 1 Elias Ross 2012-10-12 21:31:17 UTC
Created attachment 626300 [details]
simple patch for this feature

Change is very trivial, but I added some tests and things.

Comment 2 Heiko W. Rupp 2013-07-01 10:18:23 UTC
I think adding this makes sense (but we need to make sure plugins built with an earlier version still work).
The REST-api actually allows you to do this.

Spinder - as we were talking about this on friday, I'll assign it to you.

Comment 3 Heiko W. Rupp 2013-07-01 16:36:37 UTC
Actually this is already possible:

org.rhq.core.domain.measurement.MeasurementDataNumeric#MeasurementDataNumeric

and

org.rhq.core.domain.measurement.MeasurementDataNumeric#MeasurementDataNumeric

Both since at least end of 2011


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