)]}'
{"gnocchi/carbonara.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"46932f10988432d3707fb4fe4d72dd3f096673bb","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                self.ts \u003d self.ts[-self.max_size:]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _resample(self):"},{"line_number":215,"context_line":"        if self.sampling:"},{"line_number":216,"context_line":"            self.ts \u003d self.ts.resample(self.sampling,"},{"line_number":217,"context_line":"                                       how\u003dself.aggregation_method)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_4c57d1ca","line":215,"updated":"2014-07-16 16:17:30.000000000","message":"This unselective resampling seems to be the source of the problem I was seeing with standard deviations (i.e. null response always seen for this aggregate).\n\nA simple work-around would be to avoid resampling when the timeseries has only a single element:\n\n  if self.sampling and len(self.ts) \u003e 1:\n      self.ts \u003d self.ts.resample(self.sampling,\n                                 how\u003dself.aggregation_method)","commit_id":"b2f00c36e8226d486de6c49af34cfb7a39e9876f"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"5b087a5c56e741ecf8479773c811ad06e5b29993","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                self.ts \u003d self.ts[-self.max_size:]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _resample(self):"},{"line_number":215,"context_line":"        if self.sampling:"},{"line_number":216,"context_line":"            self.ts \u003d self.ts.resample(self.sampling,"},{"line_number":217,"context_line":"                                       how\u003dself.aggregation_method)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_393fe026","line":215,"in_reply_to":"baada198_453cad2f","updated":"2014-07-18 14:20:48.000000000","message":"I\u0027ve added a test that illustrates:\n\n  https://review.openstack.org/108023\n\nThe problem with the existing test is that it doesn\u0027t roundtrip to \u0026 from the storage format.","commit_id":"b2f00c36e8226d486de6c49af34cfb7a39e9876f"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9188559d2fe1108242bebd3db460f5af05ad9ea9","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                self.ts \u003d self.ts[-self.max_size:]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _resample(self):"},{"line_number":215,"context_line":"        if self.sampling:"},{"line_number":216,"context_line":"            self.ts \u003d self.ts.resample(self.sampling,"},{"line_number":217,"context_line":"                                       how\u003dself.aggregation_method)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_a89bce64","line":215,"in_reply_to":"baada198_4c57d1ca","updated":"2014-07-17 14:05:46.000000000","message":"Indeed, you need to have at least two values in the same interval of self.sampling to have a value, otherwise it has none.\nI don\u0027t think this is actually a bug anywhere, except in the test?","commit_id":"b2f00c36e8226d486de6c49af34cfb7a39e9876f"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"28ae9a58c69cf41efc0ce8cf1ba4b728a741ae5c","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                self.ts \u003d self.ts[-self.max_size:]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _resample(self):"},{"line_number":215,"context_line":"        if self.sampling:"},{"line_number":216,"context_line":"            self.ts \u003d self.ts.resample(self.sampling,"},{"line_number":217,"context_line":"                                       how\u003dself.aggregation_method)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_453cad2f","line":215,"in_reply_to":"baada198_962460c7","updated":"2014-07-18 12:28:15.000000000","message":"I still don\u0027t see your problem. :(\n\nBased on https://review.openstack.org/#/c/105185/7/gnocchi/tests/test_carbonara.py L204 could you write a failing unit test that shows what the behaviour should be?","commit_id":"b2f00c36e8226d486de6c49af34cfb7a39e9876f"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"62c24aaade8b0e190fc494ddd9483d3a2279ee3a","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                self.ts \u003d self.ts[-self.max_size:]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _resample(self):"},{"line_number":215,"context_line":"        if self.sampling:"},{"line_number":216,"context_line":"            self.ts \u003d self.ts.resample(self.sampling,"},{"line_number":217,"context_line":"                                       how\u003dself.aggregation_method)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_962460c7","line":215,"in_reply_to":"baada198_a89bce64","updated":"2014-07-17 16:39:10.000000000","message":"Well, I think it is an actual bug because _resample is called when the timeseries is deserialized from the stored representation.\n\nSo where there were multiple raw values in the same interval initially, the value in data[\u0027timeserie\u0027][\u0027archives\u0027][\u0027values\u0027] will be the *correct* standard deviation.\n\nHowever, when this is deserialized, the fact that there\u0027s only a *single* value in data[\u0027timeserie\u0027][\u0027archives\u0027][\u0027values\u0027] will cause that value to be dropped when the _resample is called on line 154 (because standard deviation is undefined for a single datapoint).\n\nSo the response from:\n\n  GET /v1/entity/UUID/measures?aggregation\u003dstd\n\nwill be empty:\n\n  {}\n\neven though the correct value has been stored by gnocchi.\n\nWhereas if we avoid that unnecessary resampling when len(self.ts)\u003e1, then this stored \u0026 correct value is actually returned by API layer.","commit_id":"b2f00c36e8226d486de6c49af34cfb7a39e9876f"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6937158c194f24b14b5960955841f3472d3cb1c9","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    def _truncate(self):"},{"line_number":143,"context_line":"        \"\"\"Truncate the timeserie.\"\"\""},{"line_number":144,"context_line":"        if self.timespan:"},{"line_number":145,"context_line":"            for timestamp, value in self.ts.iteritems():"},{"line_number":146,"context_line":"                if timestamp \u003e\u003d (self.ts.index[-1] - self.timespan):"},{"line_number":147,"context_line":"                    self.ts \u003d self.ts[timestamp:]"},{"line_number":148,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_a6da1315","line":145,"updated":"2014-07-17 21:54:58.000000000","message":"The result of this truncation over multiple runs with similar input data, seem non-deterministic because iteritems() isn\u0027t iterating over the series in a reproducible order.\n\nThe call to timeseries.iteritems() seems not to report the datapoints in the strict ascending time order assumed by the code, e.g. I\u0027ve seen the ordering:\n\n timestamp 2013-01-01 23:07:07.840000 value 7.0\n timestamp 2013-01-01 23:06:06.956000 value 6.0\n timestamp 2013-01-01 23:04:04.981000 value 4.0\n timestamp 2013-01-01 23:05:05.980000 value 5.0\n timestamp 2013-01-01 23:08:08.096000 value 8.0\n\nand also the ordering:\n\n timestamp 2013-01-01 23:06:06.527000 value 6.0\n timestamp 2013-01-01 23:04:04.075000 value 4.0\n timestamp 2013-01-01 23:07:07.987000 value 7.0\n timestamp 2013-01-01 23:05:05.902000 value 5.0\n timestamp 2013-01-01 23:08:08.579000 value 8.0","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7fc949a9f6cdd5cba5d2e2ce5a2db9fa4045fa12","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    def _truncate(self):"},{"line_number":143,"context_line":"        \"\"\"Truncate the timeserie.\"\"\""},{"line_number":144,"context_line":"        if self.timespan:"},{"line_number":145,"context_line":"            for timestamp, value in self.ts.iteritems():"},{"line_number":146,"context_line":"                if timestamp \u003e\u003d (self.ts.index[-1] - self.timespan):"},{"line_number":147,"context_line":"                    self.ts \u003d self.ts[timestamp:]"},{"line_number":148,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_a563c918","line":145,"in_reply_to":"baada198_a6da1315","updated":"2014-07-18 12:45:10.000000000","message":"Good catch, fixed.","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6937158c194f24b14b5960955841f3472d3cb1c9","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        \"\"\"Truncate the timeserie.\"\"\""},{"line_number":144,"context_line":"        if self.timespan:"},{"line_number":145,"context_line":"            for timestamp, value in self.ts.iteritems():"},{"line_number":146,"context_line":"                if timestamp \u003e\u003d (self.ts.index[-1] - self.timespan):"},{"line_number":147,"context_line":"                    self.ts \u003d self.ts[timestamp:]"},{"line_number":148,"context_line":"                    break"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_340f028a","line":146,"updated":"2014-07-17 21:54:58.000000000","message":"Since timespan is set to only twice the block_size, e.g. 120s for a (granularity\u003d60, retention\u003d3600) archive, this seems like overly-aggressive truncation.\n\nSo if we consider the timestamps in the second example in the previous comment above ...\n\nWe\u0027d truncate the series from length 5 -\u003e length 3 when we iterate to the point (timestamp\u003d2013-01-01 23:07:07.987000, value\u003d7.0) and notice that this timestamp is \u003e\u003d last-120s\n\n(where last is 2013-01-01 23:08:08.579000 in this case)\n\nSo the result is that series is pruned after reaching only 5 aggregated datapoints, as opposed to 3600 allowed. Or am I misunderstanding the meaning of the 3660 lifespan in that case?","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7fc949a9f6cdd5cba5d2e2ce5a2db9fa4045fa12","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        \"\"\"Truncate the timeserie.\"\"\""},{"line_number":144,"context_line":"        if self.timespan:"},{"line_number":145,"context_line":"            for timestamp, value in self.ts.iteritems():"},{"line_number":146,"context_line":"                if timestamp \u003e\u003d (self.ts.index[-1] - self.timespan):"},{"line_number":147,"context_line":"                    self.ts \u003d self.ts[timestamp:]"},{"line_number":148,"context_line":"                    break"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_88897c71","line":146,"in_reply_to":"baada198_340f028a","updated":"2014-07-18 12:45:10.000000000","message":"Your reading of the algo is correct, and it\u0027s what\u0027s intended to be done in this class so that looks good to me.\n\nIn the archive, 3600 means that we keep 3600 aggregated points of 60s. So this is exactly why we use a bound time series of 2*60s; just before truncating (see set_values() call) we update all the aggregated time series with all the 5 (or more) points and then we truncate to the last 2*60s since we know we won\u0027t go back that there to do any kind of aggregation.\n\nIf you see a case where that would fail, I think you should come up with a unit test it would be much simpler :)","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"}],"gnocchi/tests/test_carbonara.py":[{"author":{"_account_id":10683,"name":"Ana Malagon","email":"atmalagon@gmail.com","username":"atmalagon"},"change_message_id":"4e5be8e7da186320fd225c4d69c844c495d5bc6d","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                         r[datetime.datetime(2014, 1, 1, 12, 1, 0)])"},{"line_number":233,"context_line":"        self.assertEqual(59.304300012730948,"},{"line_number":234,"context_line":"                         r[datetime.datetime(2014, 1, 1, 12, 2, 0)])"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_fetch_agg_max(self):"},{"line_number":237,"context_line":"        tsc \u003d carbonara.TimeSerieArchive.from_definitions("},{"line_number":238,"context_line":"            [(pandas.tseries.offsets.Minute(1), 60),"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7f53276c","line":235,"updated":"2014-07-17 15:04:55.000000000","message":"Not sure if this is helpful or just confusing, but I\u0027m finding:\n\nWhen running the data for the aggregation\u003dstd test case through the API (usual steps, created the entity with [60, 60], added measures, did GET /v1/enttity/UUID/measures?aggregation\u003dstd - it returns a null result. However, if you don\u0027t add the first time point (12:00:00) and its value when posting to measures, it will return correct values for stddev.\n\nAlso, tried the same steps for different test data that is spaced equally; it seems to fail once  the time span of those points is greater than the archive sampling specified on creation. So if I make an archive [3, 40] and add up to 3 points spaced 1 sec apart to the entity, it returns a result; for 4 points I get null.","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7fc949a9f6cdd5cba5d2e2ce5a2db9fa4045fa12","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                         r[datetime.datetime(2014, 1, 1, 12, 1, 0)])"},{"line_number":233,"context_line":"        self.assertEqual(59.304300012730948,"},{"line_number":234,"context_line":"                         r[datetime.datetime(2014, 1, 1, 12, 2, 0)])"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_fetch_agg_max(self):"},{"line_number":237,"context_line":"        tsc \u003d carbonara.TimeSerieArchive.from_definitions("},{"line_number":238,"context_line":"            [(pandas.tseries.offsets.Minute(1), 60),"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_085accf1","line":235,"in_reply_to":"baada198_7f53276c","updated":"2014-07-18 12:45:10.000000000","message":"Could you turn that into a unit test in the same style as this one?","commit_id":"10d8ede5afdd9f38f42e3af506350cd8664ac1ac"}]}
