statistics shouldn't try to query samples before time of earliest sample

Bug #1295463 reported by Liusheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Undecided
Liusheng

Bug Description

In mysql scenario, when I use:

ceilometer statistics -m instance -p 36000 -q "start=2012-03-20T04:07:57;end=2014-03-10T06:17:57"

the get_meter_statistics() method will try to query sample before time of earliest sample.

I have used pdb to verify this:

        for period_start, period_end in base.iter_period(
                sample_filter.start or res.tsmin,
                sample_filter.end or res.tsmax,
                period):
            q = query.filter(models.Sample.timestamp >= period_start)
            q = q.filter(models.Sample.timestamp < period_end)
            import pdb
            pdb.set_trace()
            for r in q.all():

-----------------------------------------------------------------------------------------------------------------
> /opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py(820)get_meter_statistics()
-> for r in q.all():
(Pdb) c
> /opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py(819)get_meter_statistics()
-> pdb.set_trace()
(Pdb) p period_start
datetime.datetime(2012, 3, 20, 14, 7, 57)

Liusheng (liusheng)
Changed in ceilometer:
assignee: nobody → Liusheng (liusheng)
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/82048

Changed in ceilometer:
status: New → In Progress
Liusheng (liusheng)
Changed in ceilometer:
status: In Progress → 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.