first & last sample timestamps not included in the Resource representation

Bug #1262335 reported by Eoghan Glynn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Eoghan Glynn
Havana
Fix Released
Medium
Eoghan Glynn

Bug Description

The first & last sample timestamps for any meter associated with a resource are calculated when we retrieve the Resource models from the storage driver, via logic added in this commit:

  https://github.com/openstack/ceilometer/commit/92bed7c1

However due to a mismatch between the Resource model and the Resource representation returned by the API, these fist & last timestamps are simply discarded ... i.e. are not returned from the GET /v2/resources API call.

Since it doesn't make sense to incur the cost of calculating these timestamps without exposing them, seems we need a change such as the following to line up the two Resource classes:

diff --git a/ceilometer/api/controllers/v2.py b/ceilometer/api/controllers/v2.py
index 0e03ea5..5dba9d4 100644
--- a/ceilometer/api/controllers/v2.py
+++ b/ceilometer/api/controllers/v2.py
@@ -982,8 +982,11 @@ class Resource(_Base):
     user_id = wtypes.text
     "The ID of the user who created the resource or updated it last"

- timestamp = datetime.datetime
- "UTC date and time of the last update to any meter for the resource"
+ first_sample_timestamp = datetime.datetime
+ "UTC date & time of the first sample for any meter associated with the resource"
+
+ last_sample_timestamp = datetime.datetime
+ "UTC date & time of the last sample for any meter associated with the resource"

     metadata = {wtypes.text: wtypes.text}
     "Arbitrary metadata associated with the resource"

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
lizheming (lizheming-li)
Changed in ceilometer:
assignee: nobody → lizheming (lizheming-li)
lizheming (lizheming-li)
Changed in ceilometer:
status: Triaged → In Progress
Eoghan Glynn (eglynn)
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65118

Changed in ceilometer:
assignee: lizheming (lizheming-li) → Eoghan Glynn (eglynn)
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/65118
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=6a9dc97f962c288f5037d59d05a771823eb4bcdd
Submitter: Jenkins
Branch: master

commit 6a9dc97f962c288f5037d59d05a771823eb4bcdd
Author: Eoghan Glynn <email address hidden>
Date: Mon Jan 6 17:25:43 2014 +0000

    1st & last sample timestamps in Resource representation

    Fixes bug 1262335

    Previously, the first and last sample timestamps associated
    with a resource were calculated by the storage driver, but
    then discarded.

    Now, we include these values in the API resource representation.

    Change-Id: I3cf6081e1ac1294083f6326f85dabebab0d02203

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/65445

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/havana)

Reviewed: https://review.openstack.org/65445
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=3089be82318fef1a865bea411a1579b590d1e2b1
Submitter: Jenkins
Branch: stable/havana

commit 3089be82318fef1a865bea411a1579b590d1e2b1
Author: Eoghan Glynn <email address hidden>
Date: Mon Jan 6 17:25:43 2014 +0000

    1st & last sample timestamps in Resource representation

    Fixes bug 1262335

    Previously, the first and last sample timestamps associated
    with a resource were calculated by the storage driver, but
    then discarded.

    Now, we include these values in the API resource representation.

    Change-Id: I3cf6081e1ac1294083f6326f85dabebab0d02203
    (cherry picked from commit 6a9dc97f962c288f5037d59d05a771823eb4bcdd)

Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.