)]}'
{"monasca_agent/collector/checks_d/dropwizard.py":[{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"d8c8ad6efb073e3d04e7db6b0c415ec435bb03e9","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        use_keystone \u003d instance.get(\u0027use_keystone\u0027, False)"},{"line_number":34,"context_line":"        url \u003d instance.get(\u0027url\u0027, None)"},{"line_number":35,"context_line":"        if url is None:"},{"line_number":36,"context_line":"            raise Exception(\"Bad configuration. You must specify a url\")"},{"line_number":37,"context_line":"        ssl \u003d instance.get(\u0027disable_ssl_validation\u0027, True)"},{"line_number":38,"context_line":"        whitelist \u003d instance.get(\u0027whitelist\u0027, [])"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_62b587ec","line":36,"updated":"2015-06-16 15:11:36.000000000","message":"It may be helpful to say the dropwizard config file is missing a url, just to make it easier to track down without looking through the stack trace.","commit_id":"a216fe38a0025cdc9df2813d4bd399ffecde3203"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"d8c8ad6efb073e3d04e7db6b0c415ec435bb03e9","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        dimensions \u003d self._set_dimensions({\u0027url\u0027: addr}, instance)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        start \u003d time.time()"},{"line_number":53,"context_line":"        done \u003d False"},{"line_number":54,"context_line":"        retry \u003d False"},{"line_number":55,"context_line":"        while not done or retry:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_029cbb67","line":52,"updated":"2015-06-16 15:11:36.000000000","message":"A huge chunk of this is basically a copy from the http_check plugin. I would rather see that moved into a method that could be used by both than to have it repeated here.","commit_id":"a216fe38a0025cdc9df2813d4bd399ffecde3203"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"d8c8ad6efb073e3d04e7db6b0c415ec435bb03e9","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    return services_checks.Status.DOWN, error_string"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"            json_data \u003d json.loads(content)"},{"line_number":112,"context_line":"            try:"},{"line_number":113,"context_line":"                self.log.debug(\"Reading gauges\")"},{"line_number":114,"context_line":"                gauges \u003d json_data[\u0027gauges\u0027]"},{"line_number":115,"context_line":"                for name in gauges:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_a2c86f23","line":112,"updated":"2015-06-16 15:11:36.000000000","message":"There are a lot of very similar try/except blocks here and in all cases a failure of one skips the rest. Perhaps better is to have methods for the various types and do the try/except there or avoid it altogether by validating the data types. Actually looks like you do some of that already so maybe exceptions aren\u0027t thrown already.","commit_id":"a216fe38a0025cdc9df2813d4bd399ffecde3203"}],"monasca_agent/collector/checks_d/http_metrics.py":[{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"7a308be8f1e29fdd711348d74948ebaebb7a1e55","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                        self.log.warning(\"Invalid value \u0027{0}\u0027 for metric \u0027{1}\u0027\".format(value, metric_name))"},{"line_number":59,"context_line":"                        continue"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"                if metric_type \u003d\u003d \"gauge\":"},{"line_number":62,"context_line":"                    self.gauge(metric_name,"},{"line_number":63,"context_line":"                               value,"},{"line_number":64,"context_line":"                               dimensions\u003ddimensions)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_2ec4693e","line":61,"updated":"2015-06-22 15:44:03.000000000","message":"Since the functions are all the same you could just put the functions in a dictionary, ie methods\u003d {\u0027gauge\u0027: self.gauge}. Then run methods[metric_type](metric_name, value, dimensions\u003ddimensions)\n\nIt ends up a bit cleaner looking then lots of if/elif","commit_id":"da6ebe8480e013571ac5fab1dfac2e2cbc3e823d"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"7a308be8f1e29fdd711348d74948ebaebb7a1e55","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                               value,"},{"line_number":64,"context_line":"                               dimensions\u003ddimensions)"},{"line_number":65,"context_line":"                elif metric_type \u003d\u003d \"counter\":"},{"line_number":66,"context_line":"                    self.increment(metric[\u0027name\u0027],"},{"line_number":67,"context_line":"                                   value,"},{"line_number":68,"context_line":"                                   dimensions\u003ddimensions)"},{"line_number":69,"context_line":"                elif metric_type \u003d\u003d \"histogram\":"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_eeb9a1ed","line":66,"updated":"2015-06-22 15:44:03.000000000","message":"This one could be metric_name also.","commit_id":"da6ebe8480e013571ac5fab1dfac2e2cbc3e823d"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"7a308be8f1e29fdd711348d74948ebaebb7a1e55","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                              value,"},{"line_number":80,"context_line":"                              dimensions\u003ddimensions)"},{"line_number":81,"context_line":"                else:"},{"line_number":82,"context_line":"                    self.log.warning(\"Unrecognized type \u0027{0}\u0027 for metric \u0027{1}\u0027\".format(metric_type, metric_name))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"            success_string \u003d \u0027{0} is UP\u0027.format(addr)"},{"line_number":85,"context_line":"            self.log.debug(success_string)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_2ef2299b","line":82,"updated":"2015-06-22 15:44:03.000000000","message":"This final else could move up to the previous if metric_type in . . .","commit_id":"da6ebe8480e013571ac5fab1dfac2e2cbc3e823d"}],"monasca_setup/detection/plugins/mon.py":[{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"d8c8ad6efb073e3d04e7db6b0c415ec435bb03e9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        config.merge(dropwizard_metrics(\u0027monitoring\u0027, \u0027api\u0027, \u0027http://localhost:8081/metrics\u0027, whitelist))"},{"line_number":53,"context_line":"        return config"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # todo"},{"line_number":56,"context_line":"        # log.info(\"\\tEnabling the mon api metric collection\")"},{"line_number":57,"context_line":"        # http://localhost:8081/metrics"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_c251f30f","line":55,"updated":"2015-06-16 15:11:36.000000000","message":"Remove the todo items, this one and the one below.","commit_id":"a216fe38a0025cdc9df2813d4bd399ffecde3203"}]}
