)]}'
{"ironic_lib/metrics_utils.py":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"8a565c4daf1dde9cf035909a0379a7f971389b4c","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"METRICS_LOGGER \u003d None"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def get_metrics_logger(prefix\u003d\u0027\u0027, backend\u003dNone, host\u003dNone, delimiter\u003d\u0027.\u0027):"},{"line_number":52,"context_line":"    \"\"\"Return a metric logger with the specified prefix."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    This wraps _get_metrics_logger to allow us to invalidate the metrics"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_721585e3","line":51,"updated":"2016-07-20 19:27:32.000000000","message":"this needs a semaphore decorator, eg, @lockutils.sync()","commit_id":"b9966b113329d43372fd7baa8b100528edd16b28"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"8a565c4daf1dde9cf035909a0379a7f971389b4c","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    if METRICS_LOGGER is None:"},{"line_number":73,"context_line":"        return _get_metrics_logger(*args, **kwargs)"},{"line_number":74,"context_line":"    else:"},{"line_number":75,"context_line":"        return METRICS_LOGGER"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def _get_metrics_logger(prefix\u003d\u0027\u0027, backend\u003dNone, host\u003dNone, delimiter\u003d\u0027.\u0027):"},{"line_number":78,"context_line":"    \"\"\"Return a metric logger with the specified prefix."}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_d205517a","line":75,"updated":"2016-07-20 19:27:32.000000000","message":"I think what you want to call in the API code is more like:\n\n  @metric_utils.METRICS_LOGGER().timer(\"foo\")\n  def function...\n\nexcept that won\u0027t work, because decorators are evaluated at module compile time, not method call time, so this won\u0027t actually allow you to dynamically change METRICS_LOGGER either ... :(","commit_id":"b9966b113329d43372fd7baa8b100528edd16b28"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"8a565c4daf1dde9cf035909a0379a7f971389b4c","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    backend \u003d backend or CONF.metrics.backend"},{"line_number":114,"context_line":"    if backend \u003d\u003d \u0027statsd\u0027:"},{"line_number":115,"context_line":"        return metrics_statsd.StatsdMetricLogger(prefix, delimiter\u003ddelimiter)"},{"line_number":116,"context_line":"    elif backend \u003d\u003d \u0027noop\u0027:"},{"line_number":117,"context_line":"        return metrics.NoopMetricLogger(prefix, delimiter\u003ddelimiter)"},{"line_number":118,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_52e961e5","line":115,"updated":"2016-07-20 19:27:32.000000000","message":"besides returning the value, you need to update the module global METRICS_LOGGER so that this private method isn\u0027t called a second (third, fourth, ...) time","commit_id":"b9966b113329d43372fd7baa8b100528edd16b28"}]}
