)]}'
{"ceilometer/transformer/conversions.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"dcae2f1e54727cfa18ade828c9e6fce4749f25dc","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return counters"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"class SamplingTransformer(ScalingTransformer):"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def __init__(self, **kwargs):"},{"line_number":106,"context_line":"        \"\"\"Initialize transformer with configured parameters."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F6Bw%3D","line":103,"updated":"2013-07-09 13:00:52.000000000","message":"I had a hard time getting what \"sampling\" mean in this context, so having a high level description of the use of this transformer would be great.","commit_id":"34c698c253118bc0141ee19f76685a0e72fd1262"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"dcae2f1e54727cfa18ade828c9e6fce4749f25dc","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    def __init__(self, **kwargs):"},{"line_number":106,"context_line":"        \"\"\"Initialize transformer with configured parameters."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"           Restricting this transformer to an individual counter type"},{"line_number":109,"context_line":"           is acheived by defining a pipeline specific to that counter"},{"line_number":110,"context_line":"           type."},{"line_number":111,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F6B8%3D","line":108,"updated":"2013-07-09 13:00:52.000000000","message":"Not sure that\u0027s useful.","commit_id":"34c698c253118bc0141ee19f76685a0e72fd1262"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"dcae2f1e54727cfa18ade828c9e6fce4749f25dc","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def handle_sample(self, context, counter, source):"},{"line_number":116,"context_line":"        \"\"\"Handle a sample, converting if necessary.\"\"\""},{"line_number":117,"context_line":"        LOG.debug(\u0027handling counter %s\u0027, (counter,))"},{"line_number":118,"context_line":"        prev \u003d self.cache.get(counter.resource_id)"},{"line_number":119,"context_line":"        timestamp \u003d timeutils.parse_isotime(counter.timestamp)"},{"line_number":120,"context_line":"        self.cache[counter.resource_id] \u003d (counter.volume, timestamp)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F6Dg%3D","line":117,"updated":"2013-07-09 13:00:52.000000000","message":"Odd to have a tuple here?","commit_id":"34c698c253118bc0141ee19f76685a0e72fd1262"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"dcae2f1e54727cfa18ade828c9e6fce4749f25dc","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            prev_timestamp \u003d prev[1]"},{"line_number":125,"context_line":"            elapsed \u003d self.cache[counter.resource_id][1] - prev_timestamp"},{"line_number":126,"context_line":"            time_delta \u003d 1000 * (elapsed.seconds * (10 ** 6) +"},{"line_number":127,"context_line":"                                 elapsed.microseconds)"},{"line_number":128,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":129,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":130,"context_line":"                            else counter.volume)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F6CY%3D","line":127,"updated":"2013-07-09 13:00:52.000000000","message":"Maybe you should/could use ceilometer.openstack.common.timeutils.delta_seconds?","commit_id":"34c698c253118bc0141ee19f76685a0e72fd1262"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"eebfe9e7e454bf3824065e7b566d2d32d43687e8","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            time_delta \u003d timeutils.delta_seconds(prev_timestamp, timestamp)"},{"line_number":128,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":129,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":130,"context_line":"                            else counter.volume)"},{"line_number":131,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":132,"context_line":"                              if time_delta else 1.0)"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F4qc%3D","line":130,"updated":"2013-07-09 20:13:42.000000000","message":"not sure why this defaults to counter.volume if prev_volume is greater.","commit_id":"e0173a65edf4fc6f89f419ac2f227cf069a88e16"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"eebfe9e7e454bf3824065e7b566d2d32d43687e8","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            transformed \u003d self._convert(counter, rate_of_change)"},{"line_number":135,"context_line":"            LOG.debug(_(\u0027converted to: %s\u0027) % (transformed,))"},{"line_number":136,"context_line":"            counter \u003d self._keep(counter, transformed)"},{"line_number":137,"context_line":"        return counter"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F4mU%3D","line":137,"updated":"2013-07-09 20:13:42.000000000","message":"should we be returning the first counter if it\u0027s going to be different (not converted).","commit_id":"e0173a65edf4fc6f89f419ac2f227cf069a88e16"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"0f401b1df30e7d39f769d979cd097eef829ef199","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return counters"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"class SamplingTransformer(ScalingTransformer):"},{"line_number":104,"context_line":"    \"\"\"A sampling transformation is one based on the rate of change"},{"line_number":105,"context_line":"       of a counter volume, for example taking the current and previous"},{"line_number":106,"context_line":"       volumes of a cumlative counter and producing a gauge value based"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2F1yQ%3D","line":103,"updated":"2013-07-10 15:44:07.000000000","message":"I agree with Julien\u0027s earlier comment that this name is a bit confusing. It\u0027s producing a counter with the rate of change, so why not call it RateOfChangeTransformer?","commit_id":"04da03df91bd7f81ddf15f664ef442edd26fa9fc"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"8df576e4eefdc100837c595761e95e7cac0cf975","unresolved":false,"context_lines":[{"line_number":109,"context_line":"class RateOfChangeTransformer(ScalingTransformer):"},{"line_number":110,"context_line":"    \"\"\"Transformer based on the rate of change of a counter volume,"},{"line_number":111,"context_line":"       for example taking the current and previous volumes of a"},{"line_number":112,"context_line":"       cumlative counter and producing a gauge value based on the"},{"line_number":113,"context_line":"       proportion of some maximum used."},{"line_number":114,"context_line":"    \"\"\""},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FzlE%3D","line":112,"updated":"2013-07-11 05:49:18.000000000","message":"typo. Should be \u0027cumulative\u0027","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6d7477888b6391db753bdf47a4d8d233863a409d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"class RateOfChangeTransformer(ScalingTransformer):"},{"line_number":110,"context_line":"    \"\"\"Transformer based on the rate of change of a counter volume,"},{"line_number":111,"context_line":"       for example taking the current and previous volumes of a"},{"line_number":112,"context_line":"       cumlative counter and producing a gauge value based on the"},{"line_number":113,"context_line":"       proportion of some maximum used."},{"line_number":114,"context_line":"    \"\"\""},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FzFA%3D","line":112,"in_reply_to":"AAAAP3%2F%2FzlE%3D","updated":"2013-07-11 09:52:54.000000000","message":"Good spot, fixed in latest patch set.","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"007573e9156e43e5d0f3f40b48bc966a3c0a210a","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            time_delta \u003d timeutils.delta_seconds(prev_timestamp, timestamp)"},{"line_number":134,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":135,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":136,"context_line":"                            else counter.volume)"},{"line_number":137,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":138,"context_line":"                              if time_delta else 1.0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FzoE%3D","line":136,"updated":"2013-07-11 05:44:00.000000000","message":"Sorry I don\u0027t get this. Why set delta to counter.volume if the current volume is less than previous one?","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6d7477888b6391db753bdf47a4d8d233863a409d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            time_delta \u003d timeutils.delta_seconds(prev_timestamp, timestamp)"},{"line_number":134,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":135,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":136,"context_line":"                            else counter.volume)"},{"line_number":137,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":138,"context_line":"                              if time_delta else 1.0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FzDw%3D","line":136,"in_reply_to":"AAAAP3%2F%2Fzk4%3D","updated":"2013-07-11 09:52:54.000000000","message":"OK, how about I special case the logic for the cumulative type? i.e. allow negative deltas for gauge.","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6d7477888b6391db753bdf47a4d8d233863a409d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            time_delta \u003d timeutils.delta_seconds(prev_timestamp, timestamp)"},{"line_number":134,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":135,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":136,"context_line":"                            else counter.volume)"},{"line_number":137,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":138,"context_line":"                              if time_delta else 1.0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FzEE%3D","line":136,"in_reply_to":"AAAAP3%2F%2FzoE%3D","updated":"2013-07-11 09:52:54.000000000","message":"Because we\u0027ve found that some our cumulative counters aren\u0027t truly cumulative, in the sense of a monotonic increasing sequence. Some of these counters may be reset from time to time, for example CPU time after a instance suspend/resume.\n\nSo if we detect current \u003c previous, we effectively assume a reset to zero has occurred in the interim between polling cycles. We don\u0027t know what the peak value was before the reset, but we have a lower bound in the previous volume. So we can bound the delta on [prev + growth_before_reset, curr] with [0, curr], i.e. neglect the unknown growth_before_reset. Hence counter.volume gives us a lower bound on the volume_delta.\n\nMakes sense?","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"8df576e4eefdc100837c595761e95e7cac0cf975","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            time_delta \u003d timeutils.delta_seconds(prev_timestamp, timestamp)"},{"line_number":134,"context_line":"            volume_delta \u003d (counter.volume - prev_volume"},{"line_number":135,"context_line":"                            if prev_volume \u003c\u003d counter.volume"},{"line_number":136,"context_line":"                            else counter.volume)"},{"line_number":137,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":138,"context_line":"                              if time_delta else 1.0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2Fzk4%3D","line":136,"in_reply_to":"AAAAP3%2F%2FzoE%3D","updated":"2013-07-11 05:49:18.000000000","message":"If we only want to have this transform deal with cumulative values, maybe we should LOG.warn and ignore the current one?","commit_id":"5f229f5c32e610beb5c177415925e4af9ae802ca"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"0a553bf6f3f285ae36dd2af94993947e7dae0cf1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            transformed \u003d self._convert(counter, rate_of_change)"},{"line_number":144,"context_line":"            LOG.debug(_(\u0027converted to: %s\u0027) % (transformed,))"},{"line_number":145,"context_line":"            counter \u003d self._keep(counter, transformed)"},{"line_number":146,"context_line":"        return counter"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FyUU%3D","line":146,"updated":"2013-07-11 14:04:32.000000000","message":"same comment from patch 6: should we be returning the counter if not prev? it\u0027ll have a different unit of measurement compared to subsequent counters","commit_id":"ba4d522857564daa72c8f0f2c8bc991f5f1d7cf0"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f2b2eecdb0092a5f1d993ddc23baeb19dbf27409","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            transformed \u003d self._convert(counter, rate_of_change)"},{"line_number":144,"context_line":"            LOG.debug(_(\u0027converted to: %s\u0027) % (transformed,))"},{"line_number":145,"context_line":"            counter \u003d self._keep(counter, transformed)"},{"line_number":146,"context_line":"        return counter"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FyMQ%3D","line":146,"in_reply_to":"AAAAP3%2F%2FyUU%3D","updated":"2013-07-11 14:35:50.000000000","message":"Yeah, I thought about this too, e.g.\n\n  return counter if not self.replace else None\n\nbut it seemed kinda wrong to just totally throw the data on the floor ... i.e. not replace with something at least.\n\nAnother approach would be to replace with a zero of the new counter type?","commit_id":"ba4d522857564daa72c8f0f2c8bc991f5f1d7cf0"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"afbeede7022ed3924c2701212cc1a1134f8453e8","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                counter.type !\u003d ceilocounter.TYPE_CUMULATIVE)"},{"line_number":139,"context_line":"                            else counter.volume)"},{"line_number":140,"context_line":"            rate_of_change \u003d ((1.0 * volume_delta / time_delta)"},{"line_number":141,"context_line":"                              if time_delta else 1.0)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"            transformed \u003d self._convert(counter, rate_of_change)"},{"line_number":144,"context_line":"            LOG.debug(_(\u0027converted to: %s\u0027) % (transformed,))"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAP3%2F%2FxPE%3D","line":141,"updated":"2013-07-11 18:26:59.000000000","message":"I don\u0027t see a test for time_delta \u003d\u003d 0","commit_id":"cba0b951cb3375cfcf0fa60b8f8306b692fb3f34"}]}
