)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8585f45e8c071bf3d15c10cc9b440043cbba6858","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Addresses: BP exclude-low-sample-count"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"To avoid alarm threshold evaluation being inappropriately skewed by"},{"line_number":12,"context_line":"aggregates with anomolously low sample count, these weak data may be"},{"line_number":13,"context_line":"excluded for selected alarms by setting a new \u0027exclude_outliers\u0027"},{"line_number":14,"context_line":"field on the alarm threshold rule."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2FMIo%3D","line":12,"updated":"2014-01-16 16:20:49.000000000","message":"anomalously :)","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f26519e48a23d5c96993231cc5512b2872fad16d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Addresses: BP exclude-low-sample-count"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"To avoid alarm threshold evaluation being inappropriately skewed by"},{"line_number":12,"context_line":"aggregates with anomolously low sample count, these weak data may be"},{"line_number":13,"context_line":"excluded for selected alarms by setting a new \u0027exclude_outliers\u0027"},{"line_number":14,"context_line":"field on the alarm threshold rule."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2FL%2Fc%3D","line":12,"in_reply_to":"AAAAUH%2F%2FMIo%3D","updated":"2014-01-16 16:51:14.000000000","message":"Done","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"}],"ceilometer/alarm/evaluator/threshold.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8585f45e8c071bf3d15c10cc9b440043cbba6858","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # when exclusion of weak datapoints is enabled, we extend"},{"line_number":56,"context_line":"        # the look-back period so as to allow a clearer sample count"},{"line_number":57,"context_line":"        # trend to be established"},{"line_number":58,"context_line":"        look_back \u003d (cls.look_back if not alarm.rule.get(\u0027exclude_outliers\u0027)"},{"line_number":59,"context_line":"                     else alarm.rule[\u0027evaluation_periods\u0027])"},{"line_number":60,"context_line":"        window \u003d (alarm.rule[\u0027period\u0027] *"},{"line_number":61,"context_line":"                  (alarm.rule[\u0027evaluation_periods\u0027] + look_back))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FMIM%3D","line":58,"updated":"2014-01-16 16:20:49.000000000","message":"\u003d alarm.rule.get(\u0027exclude_outliers\u0027, cls.look_back)","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f26519e48a23d5c96993231cc5512b2872fad16d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # when exclusion of weak datapoints is enabled, we extend"},{"line_number":56,"context_line":"        # the look-back period so as to allow a clearer sample count"},{"line_number":57,"context_line":"        # trend to be established"},{"line_number":58,"context_line":"        look_back \u003d (cls.look_back if not alarm.rule.get(\u0027exclude_outliers\u0027)"},{"line_number":59,"context_line":"                     else alarm.rule[\u0027evaluation_periods\u0027])"},{"line_number":60,"context_line":"        window \u003d (alarm.rule[\u0027period\u0027] *"},{"line_number":61,"context_line":"                  (alarm.rule[\u0027evaluation_periods\u0027] + look_back))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FL%2Bk%3D","line":58,"in_reply_to":"AAAAUH%2F%2FMIM%3D","updated":"2014-01-16 16:51:14.000000000","message":"Well \u0027exclude_outliers\u0027 is boolean, so we don\u0027t want to use that value directly for the look_back number of periods.","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"801c193d3e10d1850bdaea0f3760a54202cb18b2","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # in practice statistics are always sorted by period start, not"},{"line_number":89,"context_line":"        # strictly required by the API though"},{"line_number":90,"context_line":"        statistics \u003d statistics[-alarm.rule[\u0027evaluation_periods\u0027]:]"},{"line_number":91,"context_line":"        LOG.debug(_(\u0027pruned statistics to %d\u0027) % len(statistics))"},{"line_number":92,"context_line":"        return statistics"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FMts%3D","line":90,"updated":"2014-01-16 16:01:37.000000000","message":"This change looks weird, it changes the behavior when exclude_outliers is False too. Previous code was bugged :) ?","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f26519e48a23d5c96993231cc5512b2872fad16d","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # in practice statistics are always sorted by period start, not"},{"line_number":89,"context_line":"        # strictly required by the API though"},{"line_number":90,"context_line":"        statistics \u003d statistics[-alarm.rule[\u0027evaluation_periods\u0027]:]"},{"line_number":91,"context_line":"        LOG.debug(_(\u0027pruned statistics to %d\u0027) % len(statistics))"},{"line_number":92,"context_line":"        return statistics"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FL%2BE%3D","line":90,"in_reply_to":"AAAAUH%2F%2FMts%3D","updated":"2014-01-16 16:51:14.000000000","message":"Well, the previous code was an ill-thought-out \u0026 ham-fisted attempt to achieve the same thing in a much simpler way (by always excluding the most recent datapoint, without even checking if the sample count was unusually low).","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"17b68e622a4220b0fc504118b9aa20102bafa820","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                          upper\u003dmean + 2 * stddev)"},{"line_number":81,"context_line":"            inliers, outliers \u003d utils.anomolies(statistics, key, **bounds)"},{"line_number":82,"context_line":"            if outliers:"},{"line_number":83,"context_line":"                LOG.warning(\u0027excluded weak datapoints with sample counts %s\u0027,"},{"line_number":84,"context_line":"                            [s.count for s in outliers])"},{"line_number":85,"context_line":"                statistics \u003d inliers"},{"line_number":86,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBf8%3D","line":83,"updated":"2014-01-18 17:25:56.000000000","message":"Is this really something that the deployer needs to be warned about? That might trigger a pager to go off, based on a query for an alarm created by a cloud user. Could this be LOG.debug()?","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"a169656a5ce77d56ad1709130968eb1c835e3fa3","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                          upper\u003dmean + 2 * stddev)"},{"line_number":81,"context_line":"            inliers, outliers \u003d utils.anomolies(statistics, key, **bounds)"},{"line_number":82,"context_line":"            if outliers:"},{"line_number":83,"context_line":"                LOG.warning(\u0027excluded weak datapoints with sample counts %s\u0027,"},{"line_number":84,"context_line":"                            [s.count for s in outliers])"},{"line_number":85,"context_line":"                statistics \u003d inliers"},{"line_number":86,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBUA%3D","line":83,"in_reply_to":"AAAAUH%2F%2FBf8%3D","updated":"2014-01-18 19:18:40.000000000","message":"Fair point, done.","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"0ac8468cf346f2ec328e53614b8b38250f6338d0","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        # in practice statistics are always sorted by period start, not"},{"line_number":90,"context_line":"        # strictly required by the API though"},{"line_number":91,"context_line":"        statistics \u003d statistics[-alarm.rule[\u0027evaluation_periods\u0027]:]"},{"line_number":92,"context_line":"        LOG.debug(_(\u0027pruned statistics to %d\u0027) % len(statistics))"},{"line_number":93,"context_line":"        return statistics"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FIG8%3D","line":91,"updated":"2014-01-17 06:51:39.000000000","message":"Sorry, I didn\u0027t get this. Why change from returning the first # of alarms to returning the last # of alarms in the list?","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"5af40940b2635b85311365424faee66a88e93755","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        # in practice statistics are always sorted by period start, not"},{"line_number":90,"context_line":"        # strictly required by the API though"},{"line_number":91,"context_line":"        statistics \u003d statistics[-alarm.rule[\u0027evaluation_periods\u0027]:]"},{"line_number":92,"context_line":"        LOG.debug(_(\u0027pruned statistics to %d\u0027) % len(statistics))"},{"line_number":93,"context_line":"        return statistics"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FHnI%3D","line":91,"in_reply_to":"AAAAUH%2F%2FIG8%3D","updated":"2014-01-17 08:56:09.000000000","message":"Mehdi asked a similar question in a comment on patch set 1, my response was:\n\n\"Well, the previous code was an ill-thought-out \u0026 ham-fisted attempt to achieve the same thing in a much simpler way (by always excluding the most recent datapoint, without even checking if the sample count was unusually low).\"\n\nSo basically in the previous logic, we always looked back an extra period and then excluded any data reported for the most recent period - the motivation that we can\u0027t always rely on data for the most recent period for widely dimensioned alarms, if all the potential reporters (e.g. all the instances in a large auotscaling group) haven\u0027t reported their samples yet. This logic was far too conservative in retrospect.\n\nSo the idea is that now by default we always consider the most recent period, and only exclude datapoints for selected alarms where the sample count really is anomolously low.","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"027bc17cb010b0f3d9dad372c826b9ce8fa35e88","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # the look-back period so as to allow a clearer sample count"},{"line_number":57,"context_line":"        # trend to be established"},{"line_number":58,"context_line":"        look_back \u003d (cls.look_back if not alarm.rule.get(\u0027exclude_outliers\u0027)"},{"line_number":59,"context_line":"                     else alarm.rule[\u0027evaluation_periods\u0027])"},{"line_number":60,"context_line":"        window \u003d (alarm.rule[\u0027period\u0027] *"},{"line_number":61,"context_line":"                  (alarm.rule[\u0027evaluation_periods\u0027] + look_back))"},{"line_number":62,"context_line":"        start \u003d now - datetime.timedelta(seconds\u003dwindow)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0dw%3D","line":59,"updated":"2014-01-21 19:13:14.000000000","message":"no issues here but out of curiosity, is there a reason we are doubling the window size when exclude_outliers is True? can it be another number (ie. 1.5 times) but we are doubling windows size because it\u0027s safe and convenient?","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"fb61f10004bf8837b18ccfc4aba60220e2914013","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # the look-back period so as to allow a clearer sample count"},{"line_number":57,"context_line":"        # trend to be established"},{"line_number":58,"context_line":"        look_back \u003d (cls.look_back if not alarm.rule.get(\u0027exclude_outliers\u0027)"},{"line_number":59,"context_line":"                     else alarm.rule[\u0027evaluation_periods\u0027])"},{"line_number":60,"context_line":"        window \u003d (alarm.rule[\u0027period\u0027] *"},{"line_number":61,"context_line":"                  (alarm.rule[\u0027evaluation_periods\u0027] + look_back))"},{"line_number":62,"context_line":"        start \u003d now - datetime.timedelta(seconds\u003dwindow)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0JA%3D","line":59,"in_reply_to":"AAAAUH%2F%2B0b4%3D","updated":"2014-01-21 20:18:05.000000000","message":"cool. just wanted to make sure i was making right assumption","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cc4513babc84906e247c68d445a78c9efb106917","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # the look-back period so as to allow a clearer sample count"},{"line_number":57,"context_line":"        # trend to be established"},{"line_number":58,"context_line":"        look_back \u003d (cls.look_back if not alarm.rule.get(\u0027exclude_outliers\u0027)"},{"line_number":59,"context_line":"                     else alarm.rule[\u0027evaluation_periods\u0027])"},{"line_number":60,"context_line":"        window \u003d (alarm.rule[\u0027period\u0027] *"},{"line_number":61,"context_line":"                  (alarm.rule[\u0027evaluation_periods\u0027] + look_back))"},{"line_number":62,"context_line":"        start \u003d now - datetime.timedelta(seconds\u003dwindow)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0b4%3D","line":59,"in_reply_to":"AAAAUH%2F%2B0dw%3D","updated":"2014-01-21 19:28:02.000000000","message":"Yes, the choice of factor is fairly arbitrary. The point is simply to ensure that we have a longer trend of sample counts to consider in order to better determine whether the more recent datapoints have anomalously counts. The additional older datapoints are then discarded and not used for the actual alarm evaluation.","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"027bc17cb010b0f3d9dad372c826b9ce8fa35e88","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            inliers, outliers \u003d utils.anomolies(statistics, key, lower, upper)"},{"line_number":82,"context_line":"            if outliers:"},{"line_number":83,"context_line":"                LOG.debug(\u0027excluded weak datapoints with sample counts %s\u0027,"},{"line_number":84,"context_line":"                          [s.count for s in outliers])"},{"line_number":85,"context_line":"                statistics \u003d inliers"},{"line_number":86,"context_line":"            else:"},{"line_number":87,"context_line":"                LOG.debug(\u0027no excluded weak datapoints\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0zM%3D","line":84,"updated":"2014-01-21 19:13:14.000000000","message":"add translation support _()","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cc4513babc84906e247c68d445a78c9efb106917","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            inliers, outliers \u003d utils.anomolies(statistics, key, lower, upper)"},{"line_number":82,"context_line":"            if outliers:"},{"line_number":83,"context_line":"                LOG.debug(\u0027excluded weak datapoints with sample counts %s\u0027,"},{"line_number":84,"context_line":"                          [s.count for s in outliers])"},{"line_number":85,"context_line":"                statistics \u003d inliers"},{"line_number":86,"context_line":"            else:"},{"line_number":87,"context_line":"                LOG.debug(\u0027no excluded weak datapoints\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0b0%3D","line":84,"in_reply_to":"AAAAUH%2F%2B0zM%3D","updated":"2014-01-21 19:28:02.000000000","message":"Done","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"}],"ceilometer/alarm/evaluator/utils.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8585f45e8c071bf3d15c10cc9b440043cbba6858","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def mean(s, attr\u003dNone):"},{"line_number":23,"context_line":"    \"\"\"Calculate the mean of a numeric list."},{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    item \u003d lambda i: getattr(i, attr) if attr else i"},{"line_number":26,"context_line":"    count \u003d float(len(s))"},{"line_number":27,"context_line":"    return (sum(map(item, s)) / count) if count else 0.0"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FMG8%3D","line":25,"updated":"2014-01-16 16:20:49.000000000","message":"your lambda is operator.attrgetter(attr)\n\nBasically I think having mean(s, key\u003dNone) where key is a function that _could_ be operator.attrgetter() is more inline with the rest of the Python function like e.g. sort()","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f26519e48a23d5c96993231cc5512b2872fad16d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def mean(s, attr\u003dNone):"},{"line_number":23,"context_line":"    \"\"\"Calculate the mean of a numeric list."},{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    item \u003d lambda i: getattr(i, attr) if attr else i"},{"line_number":26,"context_line":"    count \u003d float(len(s))"},{"line_number":27,"context_line":"    return (sum(map(item, s)) / count) if count else 0.0"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FL0k%3D","line":25,"in_reply_to":"AAAAUH%2F%2FMG8%3D","updated":"2014-01-16 16:51:14.000000000","message":"Good shout, done.","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8585f45e8c071bf3d15c10cc9b440043cbba6858","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    item \u003d lambda i: getattr(i, attr) if attr else i"},{"line_number":26,"context_line":"    count \u003d float(len(s))"},{"line_number":27,"context_line":"    return (sum(map(item, s)) / count) if count else 0.0"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def deltas(s, attr, m\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FMHY%3D","line":27,"updated":"2014-01-16 16:20:49.000000000","message":"I think it\u0027d be better to start with if count here and return 0 first thing.","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"f26519e48a23d5c96993231cc5512b2872fad16d","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    item \u003d lambda i: getattr(i, attr) if attr else i"},{"line_number":26,"context_line":"    count \u003d float(len(s))"},{"line_number":27,"context_line":"    return (sum(map(item, s)) / count) if count else 0.0"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def deltas(s, attr, m\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FL0Q%3D","line":27,"in_reply_to":"AAAAUH%2F%2FMHY%3D","updated":"2014-01-16 16:51:14.000000000","message":"Done, IIUC.","commit_id":"64f8f727f06ad99e84399303c50aba1747019b31"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"17b68e622a4220b0fc504118b9aa20102bafa820","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    count \u003d float(len(s))"},{"line_number":26,"context_line":"    if count:"},{"line_number":27,"context_line":"        return sum(map(key, s)) / count"},{"line_number":28,"context_line":"    return 0.0"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBfY%3D","line":27,"updated":"2014-01-18 17:25:56.000000000","message":"math.fsum() is said to be more accurate. I don\u0027t know how much precision we might lose, or if we care.","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"a169656a5ce77d56ad1709130968eb1c835e3fa3","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"\"\""},{"line_number":25,"context_line":"    count \u003d float(len(s))"},{"line_number":26,"context_line":"    if count:"},{"line_number":27,"context_line":"        return sum(map(key, s)) / count"},{"line_number":28,"context_line":"    return 0.0"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBT8%3D","line":27,"in_reply_to":"AAAAUH%2F%2FBfY%3D","updated":"2014-01-18 19:18:40.000000000","message":"Done","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"17b68e622a4220b0fc504118b9aa20102bafa820","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    \"\"\"Calculate the squared distances from mean for a numeric list."},{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    m \u003d m or mean(s, key)"},{"line_number":35,"context_line":"    squared_distance \u003d lambda i: (key(i) - m) ** 2"},{"line_number":36,"context_line":"    return map(squared_distance, s)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBfA%3D","line":35,"updated":"2014-01-18 17:25:56.000000000","message":"This could return a list comprehension to avoid the function call overhead of map() and the lambda:\n\n  return [ (key(i) - m) ** 2 for i in s ]","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"a169656a5ce77d56ad1709130968eb1c835e3fa3","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    \"\"\"Calculate the squared distances from mean for a numeric list."},{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    m \u003d m or mean(s, key)"},{"line_number":35,"context_line":"    squared_distance \u003d lambda i: (key(i) - m) ** 2"},{"line_number":36,"context_line":"    return map(squared_distance, s)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBT4%3D","line":35,"in_reply_to":"AAAAUH%2F%2FBfA%3D","updated":"2014-01-18 19:18:40.000000000","message":"Done","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"17b68e622a4220b0fc504118b9aa20102bafa820","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    return v \u003c lower or v \u003e upper"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def anomolies(s, key, **bounds):"},{"line_number":59,"context_line":"    \"\"\"Separate anomolous datapoints from the inliers."},{"line_number":60,"context_line":"    \"\"\""},{"line_number":61,"context_line":"    inliers \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBeo%3D","line":58,"updated":"2014-01-18 17:25:56.000000000","message":"If bounds can only ever contain lower and upper, it would be better to just list them explicitly here as individual arguments to make the API of this function easier to understand.","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"a169656a5ce77d56ad1709130968eb1c835e3fa3","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    return v \u003c lower or v \u003e upper"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def anomolies(s, key, **bounds):"},{"line_number":59,"context_line":"    \"\"\"Separate anomolous datapoints from the inliers."},{"line_number":60,"context_line":"    \"\"\""},{"line_number":61,"context_line":"    inliers \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FBT0%3D","line":58,"in_reply_to":"AAAAUH%2F%2FBeo%3D","updated":"2014-01-18 19:18:40.000000000","message":"Done","commit_id":"aa4acd116c0daa942b626e1e002e45e489488af6"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"027bc17cb010b0f3d9dad372c826b9ce8fa35e88","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    count \u003d float(len(s))"},{"line_number":26,"context_line":"    if count:"},{"line_number":27,"context_line":"        return math.fsum(map(key, s)) / count"},{"line_number":28,"context_line":"    return 0.0"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def deltas(s, key, m\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0yU%3D","line":28,"updated":"2014-01-21 19:13:14.000000000","message":"return math.fsum(map(key, s)) / count if count else 0.0","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cc4513babc84906e247c68d445a78c9efb106917","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    count \u003d float(len(s))"},{"line_number":26,"context_line":"    if count:"},{"line_number":27,"context_line":"        return math.fsum(map(key, s)) / count"},{"line_number":28,"context_line":"    return 0.0"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def deltas(s, key, m\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0bo%3D","line":28,"in_reply_to":"AAAAUH%2F%2B0yU%3D","updated":"2014-01-21 19:28:02.000000000","message":"I had something similar in an earlier patch set, but jd_ preferred an explicit if statement to the ternary style.","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"}],"ceilometer/tests/api/v2/test_alarm_scenarios.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"027bc17cb010b0f3d9dad372c826b9ce8fa35e88","unresolved":false,"context_lines":[{"line_number":463,"context_line":"    def test_post_alarm_outlier_exclusion_set(self):"},{"line_number":464,"context_line":"        self._do_test_post_alarm(True)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def test_post_alarm_outlier_exclusion_clear(self):"},{"line_number":467,"context_line":"        self._do_test_post_alarm(True)"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"    def test_post_alarm_outlier_exclusion_defaulted(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0jQ%3D","line":466,"updated":"2014-01-21 19:13:14.000000000","message":"test_post_alarm_outlier_exclusion_set() and test_post_alarm_outlier_exclusion_clear() appear to be the exact same test.","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"cc4513babc84906e247c68d445a78c9efb106917","unresolved":false,"context_lines":[{"line_number":463,"context_line":"    def test_post_alarm_outlier_exclusion_set(self):"},{"line_number":464,"context_line":"        self._do_test_post_alarm(True)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def test_post_alarm_outlier_exclusion_clear(self):"},{"line_number":467,"context_line":"        self._do_test_post_alarm(True)"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"    def test_post_alarm_outlier_exclusion_defaulted(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2B0bg%3D","line":466,"in_reply_to":"AAAAUH%2F%2B0jQ%3D","updated":"2014-01-21 19:28:02.000000000","message":"Meh! You\u0027re right, copy\u0027n\u0027paste error - well spotted!\n\nThe exclude_outliers arg should be false in the latter case, fixed in the latest patch set.","commit_id":"cc75a805b76282de46eff78d7856871eb5458f9b"}]}
