)]}'
{"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"4dbff916134b3c7b214f38f2d3deb9699a8dc8a2","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                \u0027var deviance \u003d (res.sdsum / res.sdcount) - values[i].sdsum;\u0027"},{"line_number":171,"context_line":"                \u0027var weight \u003d res.sdcount / ++res.sdcount;\u0027"},{"line_number":172,"context_line":"                \u0027res.weighted_distances +\u003d (Math.pow(deviance, 2) * weight);\u0027"},{"line_number":173,"context_line":"                \u0027res.sdsum +\u003d values[i].sdsum;\u0027"},{"line_number":174,"context_line":"            )"},{"line_number":175,"context_line":"        ),"},{"line_number":176,"context_line":"        finalize\u003ddict("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVn%2F%2F8co%3D","line":173,"updated":"2014-03-03 09:19:20.000000000","message":"Sorry, I\u0027m totally lost in this stddev algorithm. How can map this to the stddev definition http://en.wikipedia.org/wiki/Standard_deviation#Definition_of_population_values.\n\nDo you have links to the explanation of this algorithm?","commit_id":"be0eb843ff8f463baf7b792f29d387fc7cb997a9"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"5d704be428d32c9c110aa5f8771d1e90674bb7c4","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                \u0027var deviance \u003d (res.sdsum / res.sdcount) - values[i].sdsum;\u0027"},{"line_number":171,"context_line":"                \u0027var weight \u003d res.sdcount / ++res.sdcount;\u0027"},{"line_number":172,"context_line":"                \u0027res.weighted_distances +\u003d (Math.pow(deviance, 2) * weight);\u0027"},{"line_number":173,"context_line":"                \u0027res.sdsum +\u003d values[i].sdsum;\u0027"},{"line_number":174,"context_line":"            )"},{"line_number":175,"context_line":"        ),"},{"line_number":176,"context_line":"        finalize\u003ddict("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVn%2F%2F2yY%3D","line":173,"in_reply_to":"AAAAVn%2F%2F8co%3D","updated":"2014-03-03 20:00:40.000000000","message":"The fact the code is so fragmented due to the all the string substitution we use in the mongo driver\u0027s javascript makes it had to follow.\n\nI derived this code from some javascript I wrote for my RDO ceilometer quick-start wiki to illustrate direct access to the underlying metering store. In the fact the code is much easier to understand it you read it in consolidated form:\n\n  http://openstack.redhat.com/CeilometerQuickStart (search for \"standard deviation\")\n\nSo the basic one-pass iterative algorithm is to walk the list of mapped values and calculate:\n\n1. a measure of how much the current value deviates from the mean of the preceding values\n\n2. a weight for that deviance according to the completeness the partial mean used in step #1\n\n3. a weighted distance from the partial mean, by squaring the deviance and applying the weight as a factor\n\n4. the root of the average weighted distance then gives the standard deviation \n\nThis is similar to the famous Knuth algorithm for calculating *sample* standard deviation with successive partial means and a progressively closer variance estimate. The reason for the difference is that here we are calculating *population* standard deviation, as *all* the matching data are fed into the calculation (as opposed to say a randomly selected sub-set of the data matching the statistics query constraints).","commit_id":"be0eb843ff8f463baf7b792f29d387fc7cb997a9"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"211631ba0fbec16614ef85d9c26247d135e12620","unresolved":false,"context_lines":[{"line_number":732,"context_line":"            elif a.func in self.PARAMETERIZED_AGGREGATES[fragment_key]:"},{"line_number":733,"context_line":"                fragment_map \u003d self.PARAMETERIZED_AGGREGATES[fragment_key]"},{"line_number":734,"context_line":"                params \u003d dict(aggregate_param\u003da.param)"},{"line_number":735,"context_line":"                fragments +\u003d (fragment_map[a.func] % params)"},{"line_number":736,"context_line":"            else:"},{"line_number":737,"context_line":"                raise NotImplementedError(_(\u0027Selectable aggregate function %s\u0027"},{"line_number":738,"context_line":"                                            \u0027 is not supported\u0027) % a.func)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVn%2F%2F8LY%3D","line":735,"updated":"2014-03-03 09:38:41.000000000","message":"Like I have said into an other review a.param is directly used as bson code. Something must be done to be sure code cannot be injected.","commit_id":"be0eb843ff8f463baf7b792f29d387fc7cb997a9"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"5d704be428d32c9c110aa5f8771d1e90674bb7c4","unresolved":false,"context_lines":[{"line_number":732,"context_line":"            elif a.func in self.PARAMETERIZED_AGGREGATES[fragment_key]:"},{"line_number":733,"context_line":"                fragment_map \u003d self.PARAMETERIZED_AGGREGATES[fragment_key]"},{"line_number":734,"context_line":"                params \u003d dict(aggregate_param\u003da.param)"},{"line_number":735,"context_line":"                fragments +\u003d (fragment_map[a.func] % params)"},{"line_number":736,"context_line":"            else:"},{"line_number":737,"context_line":"                raise NotImplementedError(_(\u0027Selectable aggregate function %s\u0027"},{"line_number":738,"context_line":"                                            \u0027 is not supported\u0027) % a.func)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVn%2F%2F2w4%3D","line":735,"in_reply_to":"AAAAVn%2F%2F8LY%3D","updated":"2014-03-03 20:00:40.000000000","message":"I\u0027m not seeing the earlier review comment you mention. But I\u0027m assuming the concern is an injection attack, right? That\u0027s a really good point! I\u0027ve added aggregate.param validation in the latest patch set.","commit_id":"be0eb843ff8f463baf7b792f29d387fc7cb997a9"}]}
