<div dir="ltr"><div><div><div><div><div><div><div><div>Hi team,<br></div><br>I've decided to move discussion about aggregation in mailing list.<br></div>Here is a description about my idea and I really need your comments.<br>
<br><b>Idea:</b><br>The goal is to improve performance when user gets statistics for meter. Now we have fixed list of statistics (min, max and so on). During request a user may specify the following params:<br>1. query<br>
2. group_by<br>3. period<br><br>The idea of bp is to pre-calculate some kind of requests and store them to a separate table in database.<br>The pre-calculated statistics is called aggregates. Aggregates may be merged among each others and with any Statistics' objects. <br>
Note, that aggregates will be transparent for users. No changes in api is required during get_statistics.<br><br>Example:<br>Let's assume we have 6 Samples about 'image' meter. All of them belong to one day (e.g. 1st May) but have happened in different times:<br>
11.50, 12.25, 12.50, 13.25, 13.50 and 14.25.  User would like to get statistics about this meter from start = 11.30 till end = 14.30. So we need to process all samples. <br>But we may process these samples earlier and already have pre-calculated results for full hour 12.00 and 13.00. In this case we may get  Sample 11.50 and 14.25 from "meters" table and merge statistics for them with already calculated Statistic result from "aggregates" table.<br>
This example "saved" only 2 reads from DB. But if we consider metrics from pollsters with interval = 5 sec (720 Samples per hour) we will save 719 reads with aggregate usage.<br><br><b>Limitations: </b><br>Of course we cannot aggregate data for all periods, group_by's and queries. But we may allow user to configure what queries and group_by's he or she is interested in. For instance, it may be useful for UI where we show graph with statistics for each hour.  I think that period should not be configurable, period may be only hour and day.<br>
<br></div>Example of entries in db:<br> image_9223372035472681807                          column=H:avg, timestamp=1389255460712, value=1.0   (I will not copy all columns. The list of columns is [column=H:min, column=H:max, column=H:sum and so on])  <br>
</div>Example of filtered_aggregates in db (filter is "image by project"):<br>image_project_8c62fb0cd16c41498245095761b1a263_9223372035472681807   column=H:avg, timestamp=1389255460712, value=1.0  <br><br><br></div>
More details here: <a href="https://etherpad.openstack.org/p/ceilometer-aggregation">https://etherpad.openstack.org/p/ceilometer-aggregation</a> <br></div>Draft implementation for HBase is here: <a href="https://review.openstack.org/#/c/65681/1">https://review.openstack.org/#/c/65681/1</a><br>
<br></div>Thanks for your attention,<br></div>Nadya<br></div>