Bug 865950

Summary: Expose method to set timestamp on MeasurementDataNumeric
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: AgentAssignee: Simeon Pinder <spinder>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-01 12:36:37 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
simple patch for this feature none

Description Elias Ross 2012-10-12 17:29:00 EDT
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 17:31:17 EDT
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 06:18:23 EDT
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 12:36:37 EDT
Actually this is already possible:




Both since at least end of 2011