)]}'
{"monasca_api/common/messaging/message_formats/metrics.py":[{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"44fc2f15e08939612950fbae089a8bc2d561276d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        transformed_metrics \u003d []"},{"line_number":27,"context_line":"        for metric in metrics:"},{"line_number":28,"context_line":"            transformed_metric[\u0027metric\u0027] \u003d metric"},{"line_number":29,"context_line":"            transformed_metrics.append(ru.as_json(transformed_metric))"},{"line_number":30,"context_line":"        return transformed_metrics"},{"line_number":31,"context_line":"    else:"},{"line_number":32,"context_line":"        transformed_metric[\u0027metric\u0027] \u003d metrics"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_c26e862e","line":29,"range":{"start_line":29,"start_character":42,"end_line":29,"end_character":49},"updated":"2017-02-06 21:09:16.000000000","message":"Tomasz, I have some concern here about the level of overhead that\u0027s bundled in this as_json method.  Have you done any performance analysis between as_json and json.dumps?","commit_id":"17c4166f0a07d685e27e149fee381ec3cd0784b6"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"caaffdfa8705d8713f67225c5610668b4a0bfcfd","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from oslo_utils import timeutils"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from monasca_common.rest import utils as ru"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"def transform(metrics, tenant_id, region):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_6cd40721","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":5},"updated":"2017-05-08 14:04:39.000000000","message":"In general, I don\u0027t prefer acronyms like \"ru\" being introduced. When I first read the code I was like, what the hell is \"ru\". IMHO, it just makes it a little harder to understand the code initially. utils or rest_utils would work better I think, but utils might collide with another name.","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"da44bf382bbb38af5fb3c840e00ad85c46deb0f9","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from oslo_utils import timeutils"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from monasca_common.rest import utils as ru"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"def transform(metrics, tenant_id, region):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_d0cf1eae","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":5},"in_reply_to":"3f044301_6cd40721","updated":"2017-05-09 08:15:50.000000000","message":"Done","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"}],"monasca_api/v2/reference/alarm_definitions.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"caaffdfa8705d8713f67225c5610668b4a0bfcfd","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                                               ok_actions)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        helpers.add_links_to_resource(result, req.uri)"},{"line_number":83,"context_line":"        res.body \u003d helpers.data_to_json(result)"},{"line_number":84,"context_line":"        res.status \u003d falcon.HTTP_201"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @resource.resource_try_catch_block"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_4cc02b51","line":83,"updated":"2017-05-08 14:04:39.000000000","message":"Why not just call this function \"to_json\", as you have in other locations?","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"da44bf382bbb38af5fb3c840e00ad85c46deb0f9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                                               ok_actions)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        helpers.add_links_to_resource(result, req.uri)"},{"line_number":83,"context_line":"        res.body \u003d helpers.data_to_json(result)"},{"line_number":84,"context_line":"        res.status \u003d falcon.HTTP_201"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @resource.resource_try_catch_block"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_b0ddb271","line":83,"in_reply_to":"3f044301_4cc02b51","updated":"2017-05-09 08:15:50.000000000","message":"Yeah, might be good idea.\nWill do\n\n  to_json\n  from_json","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"}],"monasca_api/v2/reference/helpers.py":[{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"4258c54e66702c88e619ef97d48ceded940f3531","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"import six.moves.urllib.parse as urlparse"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from monasca_common.rest import utils as rest_utils"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_5ef1f16a","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":51},"updated":"2017-05-08 12:15:38.000000000","message":"Why don\u0027t you get in a line monasca_common?","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"eb67e308a31f9ac2ffdb2432b6b0170be9a9265c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"import six.moves.urllib.parse as urlparse"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from monasca_common.rest import utils as rest_utils"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_be8475b2","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":51},"in_reply_to":"3f044301_5ef1f16a","updated":"2017-05-08 12:19:56.000000000","message":"Not really sure what your comment is about ;-). Sorry, can you clarify that ?","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":18286,"name":"Shinya Kawabata","email":"s-kawabata@wx.jp.nec.com","username":"kawabata"},"change_message_id":"2f26170ac5fbaef5e1059726bbcf814bef18eed1","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"import six.moves.urllib.parse as urlparse"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from monasca_common.rest import utils as rest_utils"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_fe3e7dd8","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":51},"in_reply_to":"3f044301_be8475b2","updated":"2017-05-08 12:29:21.000000000","message":"Line 19 and 25 are monasca_common functions.\nBut there are separated. So I suggest get together one place.","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"da44bf382bbb38af5fb3c840e00ad85c46deb0f9","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"import six.moves.urllib.parse as urlparse"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from monasca_common.rest import utils as rest_utils"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_7064cae4","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":51},"in_reply_to":"3f044301_fe3e7dd8","updated":"2017-05-09 08:15:50.000000000","message":"Done","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"caaffdfa8705d8713f67225c5610668b4a0bfcfd","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                                    \u0027Request body is not valid JSON\u0027)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def data_to_json(data):"},{"line_number":49,"context_line":"    \"\"\"Converts data to JSON string."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    :param dict data: data to be transformed to JSON"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_4ca5cbb4","line":48,"updated":"2017-05-08 14:04:39.000000000","message":"Would it be better to call this \"to_json\" or \"result_to_json\"?","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"da44bf382bbb38af5fb3c840e00ad85c46deb0f9","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                                    \u0027Request body is not valid JSON\u0027)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def data_to_json(data):"},{"line_number":49,"context_line":"    \"\"\"Converts data to JSON string."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    :param dict data: data to be transformed to JSON"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_302f6240","line":48,"in_reply_to":"3f044301_4ca5cbb4","updated":"2017-05-09 08:15:50.000000000","message":"Done","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"}],"monasca_api/v2/reference/metrics.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a3fb26d7fa87910a4d201db620597821ea0f25d8","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _validate_single_metric(self, metric):"},{"line_number":86,"context_line":"        validation.metric_name(metric[\u0027name\u0027])"},{"line_number":87,"context_line":"        assert isinstance(metric[\u0027timestamp\u0027], (int, long, float)), \"Timestamp must be a number\""},{"line_number":88,"context_line":"        assert isinstance(metric[\u0027value\u0027], (int, long, float)), \"Value must be a number\""},{"line_number":89,"context_line":"        if \"dimensions\" in metric:"},{"line_number":90,"context_line":"            for dimension_key in metric[\u0027dimensions\u0027]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_c655c350","line":87,"range":{"start_line":87,"start_character":15,"end_line":87,"end_character":25},"updated":"2017-02-06 17:05:32.000000000","message":"Good catch!","commit_id":"17c4166f0a07d685e27e149fee381ec3cd0784b6"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"69f78e06ef77344042c1244fdc1a3d1616641547","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                                    dimensions, req.uri,"},{"line_number":130,"context_line":"                                    offset, req.limit,"},{"line_number":131,"context_line":"                                    start_timestamp, end_timestamp)"},{"line_number":132,"context_line":"        res.body \u003d helpers.data_to_json(result)"},{"line_number":133,"context_line":"        res.status \u003d falcon.HTTP_200"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_153b3f9c","line":132,"range":{"start_line":132,"start_character":27,"end_line":132,"end_character":39},"updated":"2017-05-08 19:07:20.000000000","message":"Tomasz, the old code here forced a utf-8 encoding on the return value.  Does the new code also do that?","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"da44bf382bbb38af5fb3c840e00ad85c46deb0f9","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                                    dimensions, req.uri,"},{"line_number":130,"context_line":"                                    offset, req.limit,"},{"line_number":131,"context_line":"                                    start_timestamp, end_timestamp)"},{"line_number":132,"context_line":"        res.body \u003d helpers.data_to_json(result)"},{"line_number":133,"context_line":"        res.status \u003d falcon.HTTP_200"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f044301_701dea64","line":132,"range":{"start_line":132,"start_character":27,"end_line":132,"end_character":39},"in_reply_to":"3f044301_153b3f9c","updated":"2017-05-09 08:15:50.000000000","message":"monasca_common code is\n\n  rest/utils.py#L53 || data \u003d json.dumps(data, **kwargs) \n\nkwargs is populated with\n\n  ensure_ascii \u003d False\n\nif not present.\n\nEffectively that means output is UTF-8.\n\nI think, I\u0027ll just put ensure_ascii to False in monasca-api code to enforce that clearly.","commit_id":"845d9db6e2cd3be76ff25a278c144e08c1d80f4f"}]}
