Jump to: navigation, search

User:Gibi

Revision as of 15:39, 24 January 2014 by Gibi (talk | contribs) (Created page with "Horizon instance statistic query: [http://paste.openstack.org/show/54676/] [http://people.redhat.com/~lsurette/OpenStack/Horizon%20Overview%20Pages_v1.0.pdf] * fact1: "instan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Horizon instance statistic query: [1] [2]

  • fact1: "instance" meter reports 1 if the instance is _allocated_ regardless of the state of the instance
  • fact2: ceilometer does not have data on deleted samples with counter_volume 0 for deleted instances obviously
  • fact3: the state of the instance is not part of the metadata of the "instance" sample

Problem 1

So first you want to calculate avg(counter_volume) grouped by resource_id then make a sum(counter_volume) grouped by project_id. The avg(counter_volume) will produce invalid result if we have 6 measurement in an hour but the instance was running only half of the time, as we will have only 3 samples instead of 6 so the avg will be 1 instead of 1/2 due to fact2. If it is not a problem to get 1 instead of 1/2 for this case then you can use distinct instead of avg.

Problem 2

Your query with two group bys cannot be expressed in one SELECT statement. We have to translate the first avg (or distinct) step to a subquery of the second step. Our original idea for complex query statistic will allow multiple group bys but we haven't planned to allow such group bys that needs subqueries.