)]}'
{"monasca_agent/collector/checks/check.py":[{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"988dddde12514e6eaf59a16d88e9f2dc30c2e8da","unresolved":false,"context_lines":[{"line_number":462,"context_line":"                print(\" Timestamp:  {0}\".format(metric.timestamp))"},{"line_number":463,"context_line":"                print(\" Name:       {0}\".format(metric.name))"},{"line_number":464,"context_line":"                print(\" Value:      {0}\".format(metric.value))"},{"line_number":465,"context_line":"                if (metric.delegated_tenant):"},{"line_number":466,"context_line":"                    print(\" Delegtd ID: {0}\".format(metric.delegated_tenant))"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"                print(\" Dimensions: \", end\u003d\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6ced46_a87f05aa","line":465,"updated":"2015-03-25 17:15:22.000000000","message":"We should add output of value_meta here. Something like:\n                print(\" Meta:       {0}\".format(metric.value_meta))","commit_id":"16c1985d1fa6609fca4ea26e8293f7df161598ba"}],"monasca_agent/collector/checks_d/host_alive.py":[{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"988dddde12514e6eaf59a16d88e9f2dc30c2e8da","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # Look at the output for a packet loss percentage"},{"line_number":83,"context_line":"        if ping.find(\u0027100%\u0027) or ping.find(\u0027100.0%\u0027) \u003e 0:"},{"line_number":84,"context_line":"            error_message \u003d \u0027ping command failed. {0} is not available.\u0027.format(host)"},{"line_number":85,"context_line":"            self.log.warn(error_message)"},{"line_number":86,"context_line":"            return False, error_message"},{"line_number":87,"context_line":"        else:"},{"line_number":88,"context_line":"            return True, None"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6ced46_0839f9f2","line":85,"updated":"2015-03-25 17:15:22.000000000","message":"I created a ping check called \"ping gateway\" in host_alive.yaml and got this error:\n\n2015-03-25 17:11:04,019 | ERROR | collector | monasca_agent.collector.checks.check.host_alive(services_checks.py:113) | Failure in ServiceCheck ping gateway\nTraceback (most recent call last):\n  File \"/usr/local/lib/python2.7/dist-packages/monasca_agent/collector/checks/services_checks.py\", line 106, in _process\n    status, msg \u003d self._check(instance)\n  File \"/usr/local/lib/python2.7/dist-packages/monasca_agent/common/../collector/checks_d/host_alive.py\", line 116, in _check\n    self.init_config.get(\u0027ping_timeout\u0027))\n  File \"/usr/local/lib/python2.7/dist-packages/monasca_agent/common/../collector/checks_d/host_alive.py\", line 85, in _test_ping\n    self.log.warn(error_message)\nNameError: global name \u0027self\u0027 is not defined","commit_id":"16c1985d1fa6609fca4ea26e8293f7df161598ba"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"937547416114a94938c52a509ac1bf38af2268f6","unresolved":false,"context_lines":[{"line_number":115,"context_line":"            success, error_message \u003d self._test_ping(instance[\u0027host_name\u0027],"},{"line_number":116,"context_line":"                                                     self.init_config.get(\u0027ping_timeout\u0027))"},{"line_number":117,"context_line":"        else:"},{"line_number":118,"context_line":"            self.log.info(\"Unrecognized alive_test \" + instance[\u0027alive_test\u0027])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        dimensions.update({\u0027test_type\u0027: test_type})"},{"line_number":121,"context_line":"        if success is True:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a6ced46_ba4019a6","line":118,"updated":"2015-03-26 00:21:18.000000000","message":"error_message doesn\u0027t get set in this case so the code will fail below where it tries to use error_message","commit_id":"2fbcf5fd11caa359937040dd56f4076fa5382640"}],"monasca_agent/collector/checks_d/http_check.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"1a5b63721be1af40b77caad7fc51d0fa7e488e89","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                        key.refresh_token()"},{"line_number":125,"context_line":"                        continue"},{"line_number":126,"context_line":"                else:"},{"line_number":127,"context_line":"                    error_string \u003d \u0027{0} is DOWN, error code: {1}\u0027.format(addr, str(resp.status))"},{"line_number":128,"context_line":"                    self.log.info(error_string)"},{"line_number":129,"context_line":"                    self.gauge(\u0027http_status\u0027,"},{"line_number":130,"context_line":"                               1,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa041b7_f25b262d","line":127,"updated":"2015-04-01 19:45:20.000000000","message":"Maybe it would be better to have error code as its value_meta rather than sticking it in the error_string","commit_id":"b9a55a00a1f4a9c5b89684a8ff532d2a0ea82052"}],"monasca_agent/common/metrics.py":[{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"c941886c511c6521b9a09472a5bf47ac7d5ec655","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def flush(self, timestamp):"},{"line_number":73,"context_line":"        try:"},{"line_number":74,"context_line":"            if self.value is not None:"},{"line_number":75,"context_line":"                res \u003d [self.formatter(metric\u003dself.name,"},{"line_number":76,"context_line":"                                      timestamp\u003dself.timestamp or timestamp,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a6ced46_f37ba1f2","line":73,"updated":"2015-03-25 23:03:41.000000000","message":"I\u0027m on the fence on whether this is made more readable or not with the try/except/finally. Aren\u0027t all of these flush methods called from the same place? Could you put try/except block there?","commit_id":"2fbcf5fd11caa359937040dd56f4076fa5382640"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"937547416114a94938c52a509ac1bf38af2268f6","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def flush(self, timestamp):"},{"line_number":73,"context_line":"        try:"},{"line_number":74,"context_line":"            if self.value is not None:"},{"line_number":75,"context_line":"                res \u003d [self.formatter(metric\u003dself.name,"},{"line_number":76,"context_line":"                                      timestamp\u003dself.timestamp or timestamp,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a6ced46_9ab99d7b","line":73,"in_reply_to":"1a6ced46_f37ba1f2","updated":"2015-03-26 00:21:18.000000000","message":"I agree that would be better. If the issue is the reset of self.value, then that can done simply by:\n\n   value \u003d self.value\n   self.value \u003d None\n   # Use value where self.value was used below","commit_id":"2fbcf5fd11caa359937040dd56f4076fa5382640"}],"monasca_agent/forwarder/api/mon.py":[{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"c941886c511c6521b9a09472a5bf47ac7d5ec655","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            m_dict \u003d measurement.__dict__"},{"line_number":101,"context_line":"            m_dict[\u0027timestamp\u0027] *\u003d 1000"},{"line_number":102,"context_line":"            value_meta \u003d m_dict[\u0027value_meta\u0027]"},{"line_number":103,"context_line":"            if not value_meta:"},{"line_number":104,"context_line":"                m_dict.pop(\u0027value_meta\u0027)"},{"line_number":105,"context_line":"            delegated_tenant \u003d m_dict.pop(\u0027delegated_tenant\u0027)"},{"line_number":106,"context_line":"            if delegated_tenant not in tenant_group:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a6ced46_f32d61ff","line":103,"updated":"2015-03-25 23:03:41.000000000","message":"Seems round about. Why not\nif m_dict[\u0027value_meta\u0027] is None:\n  del m_dict[\u0027value_meta\u0027]","commit_id":"2fbcf5fd11caa359937040dd56f4076fa5382640"}]}
