Jump to: navigation, search

Difference between revisions of "User:Gibi"

(Blanked the page)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Horizon instance statistic query:
 
[http://paste.openstack.org/show/54676/ pastebin]
 
[http://people.redhat.com/~lsurette/OpenStack/Horizon%20Overview%20Pages_v1.0.pdf horizon pdf]
 
  
* fact1: "instance" meter reports 1 if the instance is _allocated_ regardless of the state of the instance
 
* fact2: ceilometer does not have samples from the instance meter 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 for example 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.
 

Latest revision as of 16:03, 16 April 2014