Duration time is not accurate.(return 0.0)

Bug #1159656 reported by Hiroyuki Eguchi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Undecided
Unassigned

Bug Description

The cause is that JavaScript function to get MIN and MAX timestamp doesn't work correctly.

start_timestamp and end_timestamp have the same value.

curl http://localhost:8777/v1/resources/3fa21634-f79b-46e2-b87e-aa84982d8a22/meters/cpu/duration
{
  "duration": 0.0,
  "start_timestamp": "2013-03-24T14:29:57.000000",
  "end_timestamp": "2013-03-24T14:29:57.000000"
}

Revision history for this message
Julien Danjou (jdanjou) wrote :

This doesn't look like a bug, that's correct if you only have one event with this timestamp for this meters.

Revision history for this message
Hiroyuki Eguchi (h-eguchi) wrote :

Thank you for your reply.

> This doesn't look like a bug, that's correct if you only have one event with this timestamp for this meters.

There are some events for this meters. But duration time is 0.0.
It seems that the timestamp value is not correctly set in res.

■Patch

--- a/ceilometer/storage/impl_mongodb.py
+++ b/ceilometer/storage/impl_mongodb.py
@@ -166,7 +166,8 @@ class Connection(base.Connection):

     REDUCE_MIN_MAX = bson.code.Code("""
     function (key, values) {
- var res = values[0];
+ var res = { min : values[0].min,
+ max : values[0].max };
         for ( var i=1; i<values.length; i++ ) {
             if ( values[i].min < res.min )
                res.min = values[i].min;

Revision history for this message
Julien Danjou (jdanjou) wrote :

I still can't see the bug. We have tests around this function, and they works well, and from what I see your patch is a no-op. :(

Changed in ceilometer:
status: New → Incomplete
Revision history for this message
gordon chung (chungg) wrote :

i'm closing this because: it's just sitting here... and the code in question doesn't exist anymore.

Changed in ceilometer:
status: Incomplete → Invalid
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.