filter query op:gt does not work as expected

Bug #1193926 reported by fetahi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
xingzhou

Bug Description

The 'greater than' operator returns values that are equal to the specified value. For example, consider the following query that attempts to retrieve samples having a timestamp larger than a given value.

h@ubuntu:~/junk$ curl -X GET -H X-Auth-Token:8415862d5e2f423c8646d28bd9171b1f -H Content-Type:application/json http://10.0.0.1:8777/v2/meters/cpu_util -d '{"q": [{"field": "resource_id", "value": "cd0dae96-c888-4e0d-a8fd-f555998ca5e8", "op": "eq"}, {"field": "timestamp", "value": "2013-06-23 21:44:15", "op": "gt"}]}' 2>/dev/null |python -mjson.tool
[
    {
        "counter_name": "cpu_util",
        "counter_type": "gauge",
        "counter_unit": "%",
        "counter_volume": 0.28268073188435955,
        "message_id": "0d07ef88-dc4e-11e2-bac4-deadabcfcdd1",
        "project_id": "d7030309ef3c47a6ac95a01be6ddbd12",
        "resource_id": "cd0dae96-c888-4e0d-a8fd-f555998ca5e8",
        "resource_metadata": {
            "architecture": "",
            "availability_zone": "",
            "disk_gb": "",
            "display_name": "one",
            "ephemeral_gb": "",
            "host": "41378f4bbbb00b48d03cd6b79d98bd0a900f8486201243a78c67e9b0",
            "image_ref": "05f878a5-cca3-48cf-94ba-6928e9c02441",
            "image_ref_url": "http://10.0.0.1:8774/d7030309ef3c47a6ac95a01be6ddbd12/images/05f878a5-cca3-48cf-94ba-6928e9c02441",
            "instance_type": "10",
            "kernel_id": "",
            "memory_mb": "",
            "name": "instance-00000018",
            "os_type": "",
            "ramdisk_id": "",
            "reservation_id": "",
            "root_gb": "",
            "vcpus": ""
        },
        "source": "openstack",
        "timestamp": "2013-06-23T21:44:15",
        "user_id": "f45dceb47a35417f813ad7cea8fc60ce"
    }
]

fetahi (fetahi)
description: updated
xingzhou (xingzhou)
Changed in ceilometer:
assignee: nobody → xingzhou (xingzhou)
xingzhou (xingzhou)
Changed in ceilometer:
status: New → Confirmed
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/35585

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/35585
Committed: http://github.com/openstack/ceilometer/commit/0c841abf269fe8f039131cfc9d8619f32449bc88
Submitter: Jenkins
Branch: master

commit 0c841abf269fe8f039131cfc9d8619f32449bc88
Author: xingzhou <email address hidden>
Date: Tue Jul 2 03:02:44 2013 -0400

    Filter query op:gt does not work as expected

    At present, when using timestamp to filter resource or sample data, ceilometer
    is using gte for start_timestamp and lt for end_timestamp.
    This fix will pass the timestamp operator in the request to the storage level
    to support gt operator for the start_timestamp and le for the end_stamp.

    The changes will be applied to the get_resources and get_samples methods of
    hbase, mongodb and sqlalchemy.

    Change-Id: I3fb7651b588400df804ab8bb522084e766744f96
    Fixes: Bug 1193926

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-2 → 2013.2
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.