)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"0d39b8c7514f36e10c990b222041a6b5c6d81a92","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Michael James Hoppal \u003cmichael.jam.hoppal@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-21 16:36:40 -0600"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor forwarder"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Icbb4681b578c12dd17b53ba5c582dc64412ad533"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa0719c6_0beb74b1","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":18},"updated":"2016-03-22 14:52:29.000000000","message":"You should really state that this is not just a refactor, it instead changes how it works","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ca27f0fd3510565a67929927e1ae914025790510","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Michael James Hoppal \u003cmichael.jam.hoppal@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-21 16:36:40 -0600"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor forwarder"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Icbb4681b578c12dd17b53ba5c582dc64412ad533"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa0719c6_e110dc03","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":18},"in_reply_to":"fa0719c6_0beb74b1","updated":"2016-03-22 15:22:00.000000000","message":"Done","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"}],"monasca_agent/forwarder/daemon.py":[{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"560f9f8fe09f3063ff90cf35ec6aee38b81cddfe","unresolved":false,"context_lines":[{"line_number":44,"context_line":"# Maximum queue size in bytes (when this is reached, old messages are dropped)"},{"line_number":45,"context_line":"MAX_QUEUE_SIZE \u003d 30 * 1024 * 1024  # 30MB"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"MIN_BATCH_SIZE \u003d 200"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"THROTTLING_DELAY \u003d datetime.timedelta(microseconds\u003d1000000 / 2)  # 2 msg/second"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_685eb3ea","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":14},"updated":"2016-03-15 20:36:05.000000000","message":"why 200","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"de4e4c4e0f899f03aa5930f2df6053fbefabfedc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"# Maximum queue size in bytes (when this is reached, old messages are dropped)"},{"line_number":45,"context_line":"MAX_QUEUE_SIZE \u003d 30 * 1024 * 1024  # 30MB"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"MIN_BATCH_SIZE \u003d 200"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"THROTTLING_DELAY \u003d datetime.timedelta(microseconds\u003d1000000 / 2)  # 2 msg/second"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d7e92882","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":14},"in_reply_to":"1af94dfe_37687ff5","updated":"2016-03-16 19:11:02.000000000","message":"I am not sure we even need this. Why dont we just submit every time we flush. See my comment below.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"0c3f9622769b5e2339574b5cb3641f78f617ed2d","unresolved":false,"context_lines":[{"line_number":44,"context_line":"# Maximum queue size in bytes (when this is reached, old messages are dropped)"},{"line_number":45,"context_line":"MAX_QUEUE_SIZE \u003d 30 * 1024 * 1024  # 30MB"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"MIN_BATCH_SIZE \u003d 200"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"THROTTLING_DELAY \u003d datetime.timedelta(microseconds\u003d1000000 / 2)  # 2 msg/second"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_37687ff5","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":14},"in_reply_to":"1af94dfe_685eb3ea","updated":"2016-03-16 02:42:48.000000000","message":"200 was a value we used to use in our older performance tests.  We\u0027re going to have to find a good default that balances throughput with performance.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"ac770fcf25871d577d26c0356b4b2744fd8e23dc","unresolved":false,"context_lines":[{"line_number":54,"context_line":"class StatusHandler(tornado.web.RequestHandler):"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get(self):"},{"line_number":57,"context_line":"        # TODO(joe): Figure out what this is for"},{"line_number":58,"context_line":"        self.write(\"disabled\")"},{"line_number":59,"context_line":"        # threshold \u003d int(self.get_argument(\u0027threshold\u0027, -1))"},{"line_number":60,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_829e8054","line":57,"range":{"start_line":57,"start_character":21,"end_line":57,"end_character":27},"updated":"2016-03-15 20:00:33.000000000","message":"It does not look like this is ever called. I threw a pdb trace in here and never reached it running the agent. Could be called in some edge case though.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"267b0803c9bb748104ce3a0851d693012a8a6835","unresolved":false,"context_lines":[{"line_number":54,"context_line":"class StatusHandler(tornado.web.RequestHandler):"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get(self):"},{"line_number":57,"context_line":"        # TODO(joe): Figure out what this is for"},{"line_number":58,"context_line":"        self.write(\"disabled\")"},{"line_number":59,"context_line":"        # threshold \u003d int(self.get_argument(\u0027threshold\u0027, -1))"},{"line_number":60,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_9481964d","line":57,"range":{"start_line":57,"start_character":21,"end_line":57,"end_character":27},"in_reply_to":"1af94dfe_829e8054","updated":"2016-03-15 22:18:29.000000000","message":"So the write writes to a buffer which i dont believe we flush. Also this statushandler is used for r\"/status/?\" by tornado which we only hit in win32/gui.py. Removing this","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"0faf317884d30f1d111b6e8aa586c1df1cb20e6c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self._ioloop \u003d None"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        self._port \u003d int(port)"},{"line_number":109,"context_line":"        self._flush_interval \u003d 1"},{"line_number":110,"context_line":"        self._non_local_traffic \u003d agent_config.get(\"non_local_traffic\", False)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        logging.getLogger().setLevel(agent_config.get(\u0027log_level\u0027, logging.INFO))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_283146a3","line":109,"range":{"start_line":109,"start_character":31,"end_line":109,"end_character":32},"updated":"2016-03-15 22:55:36.000000000","message":"are you meaning to flush every 1 ms?","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"0c3f9622769b5e2339574b5cb3641f78f617ed2d","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self._ioloop \u003d None"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        self._port \u003d int(port)"},{"line_number":109,"context_line":"        self._flush_interval \u003d 1"},{"line_number":110,"context_line":"        self._non_local_traffic \u003d agent_config.get(\"non_local_traffic\", False)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        logging.getLogger().setLevel(agent_config.get(\u0027log_level\u0027, logging.INFO))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d7779bd2","line":109,"range":{"start_line":109,"start_character":31,"end_line":109,"end_character":32},"in_reply_to":"1af94dfe_283146a3","updated":"2016-03-16 02:42:48.000000000","message":"It should be in seconds but I might be wrong about that.  Every millisecond is a bit aggressive.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ee145a0259c96cf271e891685116ac3d84c0a5b0","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self._ioloop \u003d None"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        self._port \u003d int(port)"},{"line_number":109,"context_line":"        self._flush_interval \u003d 1"},{"line_number":110,"context_line":"        self._non_local_traffic \u003d agent_config.get(\"non_local_traffic\", False)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        logging.getLogger().setLevel(agent_config.get(\u0027log_level\u0027, logging.INFO))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_da45cd70","line":109,"range":{"start_line":109,"start_character":31,"end_line":109,"end_character":32},"in_reply_to":"1af94dfe_771654a8","updated":"2016-03-16 19:39:25.000000000","message":"We\u0027ll need to adjust this then.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"de4e4c4e0f899f03aa5930f2df6053fbefabfedc","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self._ioloop \u003d None"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        self._port \u003d int(port)"},{"line_number":109,"context_line":"        self._flush_interval \u003d 1"},{"line_number":110,"context_line":"        self._non_local_traffic \u003d agent_config.get(\"non_local_traffic\", False)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        logging.getLogger().setLevel(agent_config.get(\u0027log_level\u0027, logging.INFO))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_771654a8","line":109,"range":{"start_line":109,"start_character":31,"end_line":109,"end_character":32},"in_reply_to":"1af94dfe_d7779bd2","updated":"2016-03-16 19:11:02.000000000","message":"it is in milliseconds","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"7a0aa8e4d11f62bfed8e0717273dff9ee65c7e5f","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self._ioloop \u003d None"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        self._port \u003d int(port)"},{"line_number":109,"context_line":"        self._flush_interval \u003d 1"},{"line_number":110,"context_line":"        self._non_local_traffic \u003d agent_config.get(\"non_local_traffic\", False)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        logging.getLogger().setLevel(agent_config.get(\u0027log_level\u0027, logging.INFO))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_bdb43bd1","line":109,"range":{"start_line":109,"start_character":31,"end_line":109,"end_character":32},"in_reply_to":"1af94dfe_da45cd70","updated":"2016-03-16 19:49:59.000000000","message":"it is in the newest review on this","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"560f9f8fe09f3063ff90cf35ec6aee38b81cddfe","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        log.info(\"wrote {}\".format(len(MESSAGE_BATCH)))"},{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_e84be329","line":186,"range":{"start_line":186,"start_character":12,"end_line":186,"end_character":25},"updated":"2016-03-15 20:36:05.000000000","message":"if we are posting metrics and our collector posts to the forwarder at the same time will we not run into a race condition with this?","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"de4e4c4e0f899f03aa5930f2df6053fbefabfedc","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        log.info(\"wrote {}\".format(len(MESSAGE_BATCH)))"},{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d7364851","line":186,"range":{"start_line":186,"start_character":12,"end_line":186,"end_character":25},"in_reply_to":"1af94dfe_d75e7b44","updated":"2016-03-16 19:11:02.000000000","message":"perfect thank you for clarifying","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"0c3f9622769b5e2339574b5cb3641f78f617ed2d","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        log.info(\"wrote {}\".format(len(MESSAGE_BATCH)))"},{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_d75e7b44","line":186,"range":{"start_line":186,"start_character":12,"end_line":186,"end_character":25},"in_reply_to":"1af94dfe_e84be329","updated":"2016-03-16 02:42:48.000000000","message":"No, they should both run in a single thread so it can run either the endpoint handler or the callback but not both at once.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"560f9f8fe09f3063ff90cf35ec6aee38b81cddfe","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"},{"line_number":190,"context_line":"            log.exception(\u0027Error flushing metrics to remote endpoints\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_68e9931a","line":187,"range":{"start_line":187,"start_character":17,"end_line":187,"end_character":37},"updated":"2016-03-15 20:36:05.000000000","message":"we dont use this anywhere even though we set it","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"7a0aa8e4d11f62bfed8e0717273dff9ee65c7e5f","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"},{"line_number":190,"context_line":"            log.exception(\u0027Error flushing metrics to remote endpoints\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_a0ea540d","line":187,"range":{"start_line":187,"start_character":17,"end_line":187,"end_character":37},"in_reply_to":"1af94dfe_1dd0cf1e","updated":"2016-03-16 19:49:59.000000000","message":"true, I mean could we catch that error and throw out that bad metric instead of backing off? and hopefully our validator is catching everything now (seems to never be the case :))","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"de4e4c4e0f899f03aa5930f2df6053fbefabfedc","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"},{"line_number":190,"context_line":"            log.exception(\u0027Error flushing metrics to remote endpoints\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_f79f044e","line":187,"range":{"start_line":187,"start_character":17,"end_line":187,"end_character":37},"in_reply_to":"1af94dfe_574a6b84","updated":"2016-03-16 19:11:02.000000000","message":"if we do a backoff that should be in the monasca api class of the forwarder that is where we do a backoff if keystone is down. Also if the API can not be hit that info is not passed up to this class. I am not sure if we need a backoff for the API even. We do not implement one right now. And it is not like we have seen our agent take down the API unlike keystone. The only reason we usually can not hit the API anyway is if it is in a failed state or down. What are your thoughts?","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"0c3f9622769b5e2339574b5cb3641f78f617ed2d","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"},{"line_number":190,"context_line":"            log.exception(\u0027Error flushing metrics to remote endpoints\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_574a6b84","line":187,"range":{"start_line":187,"start_character":17,"end_line":187,"end_character":37},"in_reply_to":"1af94dfe_68e9931a","updated":"2016-03-16 02:42:48.000000000","message":"That\u0027s a variable for the TODO in the flush function.  Basically wondering if we want to track failures and implement some backoff logic.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ee145a0259c96cf271e891685116ac3d84c0a5b0","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            self._endpoint.post_metrics(MESSAGE_BATCH)"},{"line_number":186,"context_line":"            MESSAGE_BATCH \u003d []"},{"line_number":187,"context_line":"            self._flush_failure_count \u003d 0"},{"line_number":188,"context_line":"            self._unflushed_batch_count \u003d 0"},{"line_number":189,"context_line":"        except Exception:"},{"line_number":190,"context_line":"            log.exception(\u0027Error flushing metrics to remote endpoints\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_1dd0cf1e","line":187,"range":{"start_line":187,"start_character":17,"end_line":187,"end_character":37},"in_reply_to":"1af94dfe_f79f044e","updated":"2016-03-16 19:39:25.000000000","message":"We don\u0027t implement a backoff right now but this will attempt to connect to the API 15x more frequently than the current agent.\n\nOne concern would be something slipping through our validation in the aggregator that would cause a batch to be rejected.  If that happens and we start retrying every second I think the API would be unhappy.  Basically I want to make sure that if something goes wrong we don\u0027t accidentally DDOS the API.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"560f9f8fe09f3063ff90cf35ec6aee38b81cddfe","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        # TODO(joe) backoff for failed writes to API?"},{"line_number":197,"context_line":"        if (len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE"},{"line_number":198,"context_line":"           or self._unflushed_batch_count \u003e\u003d 5):"},{"line_number":199,"context_line":"            self._post_metrics()"},{"line_number":200,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_885cdf26","line":197,"range":{"start_line":197,"start_character":31,"end_line":197,"end_character":33},"updated":"2016-03-15 20:36:05.000000000","message":"Little confused why you are using unflushed_batch_count. It looks like you are looking if we either hit 200 batches or have tried to flush 5 times. Why those two numbers? and is that to short of time?","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"7a0aa8e4d11f62bfed8e0717273dff9ee65c7e5f","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        # TODO(joe) backoff for failed writes to API?"},{"line_number":197,"context_line":"        if (len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE"},{"line_number":198,"context_line":"           or self._unflushed_batch_count \u003e\u003d 5):"},{"line_number":199,"context_line":"            self._post_metrics()"},{"line_number":200,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_a04ed46c","line":197,"range":{"start_line":197,"start_character":31,"end_line":197,"end_character":33},"in_reply_to":"1af94dfe_1ddf2f6a","updated":"2016-03-16 19:49:59.000000000","message":"okay I am fine with leaving this thank you for the explanation. I was going to just flush every five seconds regardless but that doesnt solve if we have a high load coming through or a check takes a little bit longer and we want to forward that to the API as quick as we can.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"0c3f9622769b5e2339574b5cb3641f78f617ed2d","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        # TODO(joe) backoff for failed writes to API?"},{"line_number":197,"context_line":"        if (len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE"},{"line_number":198,"context_line":"           or self._unflushed_batch_count \u003e\u003d 5):"},{"line_number":199,"context_line":"            self._post_metrics()"},{"line_number":200,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_f72c57ad","line":197,"range":{"start_line":197,"start_character":31,"end_line":197,"end_character":33},"in_reply_to":"1af94dfe_885cdf26","updated":"2016-03-16 02:42:48.000000000","message":"The _unflushed_batch_count is there to handle the fact that we can\u0027t inform the forwarder that we\u0027ve finished a collection run or if we have a check plugin take a long time.\n\nThe five tries I pulled out of thin air.  No idea if it\u0027s a good number or not.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":15027,"name":"Michael Hoppal","email":"michael.jam.hoppal@hpe.com","username":"michael-hoppal"},"change_message_id":"de4e4c4e0f899f03aa5930f2df6053fbefabfedc","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        # TODO(joe) backoff for failed writes to API?"},{"line_number":197,"context_line":"        if (len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE"},{"line_number":198,"context_line":"           or self._unflushed_batch_count \u003e\u003d 5):"},{"line_number":199,"context_line":"            self._post_metrics()"},{"line_number":200,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_f7f42488","line":197,"range":{"start_line":197,"start_character":31,"end_line":197,"end_character":33},"in_reply_to":"1af94dfe_f72c57ad","updated":"2016-03-16 19:11:02.000000000","message":"Well wouldnt you need to know the amount of plugins that are configured so you know how many batches are coming in to see if the collector run is done. IMO we should just be submitting every time we try to flush regardless. What are your thoughts?","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ee145a0259c96cf271e891685116ac3d84c0a5b0","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        # TODO(joe) backoff for failed writes to API?"},{"line_number":197,"context_line":"        if (len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE"},{"line_number":198,"context_line":"           or self._unflushed_batch_count \u003e\u003d 5):"},{"line_number":199,"context_line":"            self._post_metrics()"},{"line_number":200,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_1ddf2f6a","line":197,"range":{"start_line":197,"start_character":31,"end_line":197,"end_character":33},"in_reply_to":"1af94dfe_f7f42488","updated":"2016-03-16 19:39:25.000000000","message":"Flushing every time we get a bit of data would kill performance.  With our python API there was a difference of 40x between batched and unbatched writes to kafka.\n\nWe don\u0027t need to know how many metrics we expect to collect.  The way this should be working, and I did it quickly so it\u0027s possible it\u0027s wrong, is that it will write out batches of a certain size that are still performant (we\u0027ll have to determine that size) but if it has data and hasn\u0027t reached the batch size after five seconds it will write regardless.  More or less the same method we use in the Persister when we write to Vertica.\n\nThis is attempting to make sure that the normal case still functions effectively while allowing the outside case (collection run finished, long running check plugin, etc) to still write within a reasonable about of time.\n\nIdeally we can take a look at the statsd integration next and allow that to interleave with normal collection runs.  If we can do that then we don\u0027t need the forwarder at all and we can do it directly in the collector so we\u0027ll know exactly when a collection run is finished.","commit_id":"258743a2d2c07925289bc5d59d669eb0bfbd27f0"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"b1d59ae283d7db165f7e090b71c9682341af12b7","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    def flush(self):"},{"line_number":162,"context_line":"        if not MESSAGE_BATCH:"},{"line_number":163,"context_line":"            return"},{"line_number":164,"context_line":"        if len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE or self._unflushed_batch_count \u003e\u003d 5:"},{"line_number":165,"context_line":"            self._post_metrics()"},{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            self._unflushed_batch_count +\u003d 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_646361b2","line":164,"updated":"2016-03-21 22:25:03.000000000","message":"will this hold metrics too long if we haven\u0027t reached the unflushed_batch_count \u003e\u003d 5?  How often is unflushed_batch_count updated?","commit_id":"9249ae89c5fab1802e7d4d4b1ad19d6c87078c61"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"594b1b0002b457028187d069f1e09ad5d499f5eb","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    def flush(self):"},{"line_number":162,"context_line":"        if not MESSAGE_BATCH:"},{"line_number":163,"context_line":"            return"},{"line_number":164,"context_line":"        if len(MESSAGE_BATCH) \u003e\u003d MIN_BATCH_SIZE or self._unflushed_batch_count \u003e\u003d 5:"},{"line_number":165,"context_line":"            self._post_metrics()"},{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            self._unflushed_batch_count +\u003d 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_04e8a5e1","line":164,"in_reply_to":"fa0719c6_646361b2","updated":"2016-03-21 22:30:40.000000000","message":"unflushed_batch_count is updated every time flush() is called.  Right now that\u0027s every second so it\u0027ll flush every 5 seconds regardless.  Craig suggested making that configurable and/or lowering the default to 3 seconds.","commit_id":"9249ae89c5fab1802e7d4d4b1ad19d6c87078c61"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"0d39b8c7514f36e10c990b222041a6b5c6d81a92","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"log \u003d logging.getLogger(\u0027forwarder\u0027)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"# Max amount of iterations to wait to met min batch size before flushing"},{"line_number":41,"context_line":"MAX_FLUSH_ATTEMPTS \u003d 3"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"MIN_BATCH_SIZE \u003d 200"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_c1bddbd8","line":40,"range":{"start_line":40,"start_character":38,"end_line":40,"end_character":41},"updated":"2016-03-22 14:52:29.000000000","message":"meet?","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ca27f0fd3510565a67929927e1ae914025790510","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"log \u003d logging.getLogger(\u0027forwarder\u0027)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"# Max amount of iterations to wait to met min batch size before flushing"},{"line_number":41,"context_line":"MAX_FLUSH_ATTEMPTS \u003d 3"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"MIN_BATCH_SIZE \u003d 200"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_418d487a","line":40,"range":{"start_line":40,"start_character":38,"end_line":40,"end_character":41},"in_reply_to":"fa0719c6_c1bddbd8","updated":"2016-03-22 15:22:00.000000000","message":"Done","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"0d39b8c7514f36e10c990b222041a6b5c6d81a92","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"MIN_BATCH_SIZE \u003d 200"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"MESSAGE_BATCH \u003d []"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# In seconds"},{"line_number":48,"context_line":"FLUSH_INTERVAL \u003d 1"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_c192fb4a","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":13},"updated":"2016-03-22 14:52:29.000000000","message":"Upper case is usually used for constants, this is instead a global variable","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ca27f0fd3510565a67929927e1ae914025790510","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"MIN_BATCH_SIZE \u003d 200"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"MESSAGE_BATCH \u003d []"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# In seconds"},{"line_number":48,"context_line":"FLUSH_INTERVAL \u003d 1"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_81eda027","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":13},"in_reply_to":"fa0719c6_c192fb4a","updated":"2016-03-22 15:22:00.000000000","message":"Done","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"0d39b8c7514f36e10c990b222041a6b5c6d81a92","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def post(self):"},{"line_number":53,"context_line":"        \"\"\"Read the message and add it to the batch."},{"line_number":54,"context_line":"            Batch will be sent to Monasca API once the batch size or max wait time"},{"line_number":55,"context_line":"            has been reached. Whatever one first."},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        global MESSAGE_BATCH"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_c1b95bcd","line":55,"range":{"start_line":55,"start_character":30,"end_line":55,"end_character":34},"updated":"2016-03-22 14:52:29.000000000","message":"Which?","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ca27f0fd3510565a67929927e1ae914025790510","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def post(self):"},{"line_number":53,"context_line":"        \"\"\"Read the message and add it to the batch."},{"line_number":54,"context_line":"            Batch will be sent to Monasca API once the batch size or max wait time"},{"line_number":55,"context_line":"            has been reached. Whatever one first."},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        global MESSAGE_BATCH"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_01da3078","line":55,"range":{"start_line":55,"start_character":30,"end_line":55,"end_character":34},"in_reply_to":"fa0719c6_c1b95bcd","updated":"2016-03-22 15:22:00.000000000","message":"Done","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"0d39b8c7514f36e10c990b222041a6b5c6d81a92","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self._unflushed_iterations \u003d 0"},{"line_number":72,"context_line":"        self._endpoint \u003d mon.MonascaAPI(agent_config)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        self._ioloop \u003d None"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        self._port \u003d int(port)"},{"line_number":77,"context_line":"        self._flush_interval \u003d FLUSH_INTERVAL * 1000"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_1c21fc9f","line":74,"range":{"start_line":74,"start_character":8,"end_line":74,"end_character":27},"updated":"2016-03-22 14:52:29.000000000","message":"Why initialize this? stop() will still fail if _ioloop is None","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"ca27f0fd3510565a67929927e1ae914025790510","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self._unflushed_iterations \u003d 0"},{"line_number":72,"context_line":"        self._endpoint \u003d mon.MonascaAPI(agent_config)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        self._ioloop \u003d None"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        self._port \u003d int(port)"},{"line_number":77,"context_line":"        self._flush_interval \u003d FLUSH_INTERVAL * 1000"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_a15f04e4","line":74,"range":{"start_line":74,"start_character":8,"end_line":74,"end_character":27},"in_reply_to":"fa0719c6_1c21fc9f","updated":"2016-03-22 15:22:00.000000000","message":"This may just be personal preference but I don\u0027t like it when functions add new class scoped variables.  I added it here because I wanted to make it clear up front that it was part of the class.  I\u0027ll add a trap in stop though so we don\u0027t try to stop an ioloop we haven\u0027t started yet.","commit_id":"32f7c80468a4cf52ac7065244a95451438e6b803"}]}
