)]}'
{"swift/common/utils.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"5ee85ddb48f21d967a105f2fce723712cdb2e4e0","unresolved":false,"context_lines":[{"line_number":470,"context_line":"    wsgi server controllers, based on response code."},{"line_number":471,"context_line":"    \"\"\""},{"line_number":472,"context_line":"    def timing_func(func):"},{"line_number":473,"context_line":"        @functools.wraps(func)"},{"line_number":474,"context_line":"        def _timing_stats(controller, *args, **kwargs):"},{"line_number":475,"context_line":"            start_time \u003d time.time()"},{"line_number":476,"context_line":"            resp \u003d func(controller, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALn%2F%2FyKg%3D","line":473,"updated":"2012-11-06 17:44:53.000000000","message":"Suggestion:\n\nIf you were to say \"method \u003d func.func_name\" here, you wouldn\u0027t need to pass \"method\" as an argument to timing_stats.\n\nThat way, you wouldn\u0027t have to write the method name twice, so this:\n\n @timing_stats(\u0027POST\u0027)\n def POST(self, ...):\n\nbecomes this:\n\n @timing_stats\n def POST(self, ...):","commit_id":"fb5dad7e0d36e260f45047bc2048d46a0af03b57"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"15a1a8bf3dcad906143aa578585fdc3ef0f2cccc","unresolved":false,"context_lines":[{"line_number":477,"context_line":"            if is_success(resp.status_int) or is_redirection(resp.status_int):"},{"line_number":478,"context_line":"                controller.logger.timing_since(method + \u0027.timing\u0027, start_time)"},{"line_number":479,"context_line":"            else:"},{"line_number":480,"context_line":"                controller.logger.increment(method + \u0027.errors\u0027)"},{"line_number":481,"context_line":"            return resp"},{"line_number":482,"context_line":"        return _timing_stats"},{"line_number":483,"context_line":"    return timing_func"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALn%2F%2FyMk%3D","line":480,"updated":"2012-11-06 17:35:20.000000000","message":"I had a funny distinction between what incremented .errors and what incremented a .timing.  Some \"errors\" (notably 404s), I wanted timing data on.\n\nI don\u0027t want to lose that... but even further, now that I think about it again, I think tracking timing info for *all* errors, not just 404s and whatever other arbitrary decisions I made in the orig patch(es), would be beneficial.\n\nCan you change the else block to something like:\n\n controller.logger.timing_since(method + \u0027.errors.timing\u0027, start_time)\n\nNote that the metric name still ends in \".timing\"; that\u0027s very important for Graphite schema rules which may use pattern matching to handle StatsD\u0027s aggregated timing stats.  *We depend on that.*","commit_id":"fb5dad7e0d36e260f45047bc2048d46a0af03b57"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"15a1a8bf3dcad906143aa578585fdc3ef0f2cccc","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"        mock_controller \u003d MockController(404)"},{"line_number":1023,"context_line":"        test_method(mock_controller)"},{"line_number":1024,"context_line":"        self.assertEquals(mock_controller.called, \u0027increment\u0027)"},{"line_number":1025,"context_line":"        self.assertEquals(mock_controller.args[0], \u0027METHOD.errors\u0027)"},{"line_number":1026,"context_line":""},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"class TestStatsdLoggingDelegation(unittest.TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALn%2F%2FyNY%3D","line":1025,"updated":"2012-11-06 17:35:20.000000000","message":"Can you just assertEquals\n\n mock_controller.args\n\nwith\n\n [\u0027METHOD.errors\u0027]","commit_id":"fb5dad7e0d36e260f45047bc2048d46a0af03b57"}]}
