)]}'
{"agent.yaml.template":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"63fd8aa858f2b66a5aceb5fe6ffd6408bdf308ae","unresolved":false,"context_lines":[{"line_number":73,"context_line":"  check_freq: {args.check_frequency}"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"  # Number of Collector Threads to run"},{"line_number":76,"context_line":"  collector_threads: {args.collector_threads}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"  # Threshold value for warning on collection time of each check (in seconds)"},{"line_number":79,"context_line":"  sub_collection_warn: 6"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"7aa08908_7b88dd22","line":76,"range":{"start_line":76,"start_character":2,"end_line":76,"end_character":19},"updated":"2016-06-17 16:29:33.000000000","message":"Might want to call this num_collector_threads, to make a little more descriptive.","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"e5252fca8f63da07b320ca925a21340e0d962fbb","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"  # Maximum number of collection cycles where all of the threads in the pool are"},{"line_number":79,"context_line":"  # still running plugins before the collector will exit"},{"line_number":80,"context_line":"  max_pool_full_count: {args.max_pool_full_count}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  # Threshold value for warning on collection time of each check (in seconds)"},{"line_number":83,"context_line":"  sub_collection_warn: 6"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"3aaa91ec_8ac25ce7","line":80,"range":{"start_line":80,"start_character":2,"end_line":80,"end_character":21},"updated":"2016-06-24 20:16:30.000000000","message":"This variable name seems a little unclear. Would something like max_pool_full_retries be better?","commit_id":"50c731b6659592bb84fa4956efba879691205acd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"429b1e8c914394772dad7f2e0824df5ebd07ac75","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"  # Maximum number of collection cycles where all of the threads in the pool are"},{"line_number":79,"context_line":"  # still running plugins before the collector will exit"},{"line_number":80,"context_line":"  max_pool_full_count: {args.max_pool_full_count}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  # Threshold value for warning on collection time of each check (in seconds)"},{"line_number":83,"context_line":"  sub_collection_warn: 6"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"3aaa91ec_09fcb73c","line":80,"range":{"start_line":80,"start_character":2,"end_line":80,"end_character":21},"in_reply_to":"3aaa91ec_8ac25ce7","updated":"2016-06-24 21:46:26.000000000","message":"I never liked that either. Changed it to pool_full_max_retries","commit_id":"50c731b6659592bb84fa4956efba879691205acd"}],"docs/Agent.md":[{"author":{"_account_id":11155,"name":"Ryan Bak","email":"ryan.bak@twcable.com","username":"ryanmbak"},"change_message_id":"2d372719f39c1063de77787e41708c26af266db8","unresolved":false,"context_lines":[{"line_number":94,"context_line":"| project_domain_name | Project domain name for keystone authentication | |"},{"line_number":95,"context_line":"| project_id | Keystone project id  for keystone authentication | |"},{"line_number":96,"context_line":"| check_frequency | How often to run metric collection in seconds | 60 |"},{"line_number":97,"context_line":"| collector_threads | Number of Threads to use in Collector for running checks | 1 |"},{"line_number":98,"context_line":"| keystone_url | This is a required parameter that specifies the url of the keystone api for retrieving tokens. It must be a v3 endpoint. | http://192.168.1.5:35357/v3 |"},{"line_number":99,"context_line":"| dimensions | A comma separated list of key:value pairs to include as dimensions in all submitted metrics| region:a,az:1 |"},{"line_number":100,"context_line":"| service | This is an optional parameter that specifies the name of the service associated with this particular node | nova, cinder, myservice |"}],"source_content_type":"text/x-markdown","patch_set":3,"id":"7aa08908_29b0c842","line":97,"updated":"2016-06-17 17:32:55.000000000","message":"You might want a little more documentation here.  services_checks already spawn their own threads and have parameters to control both the threads per check and maximum allowed threads.  From just this description it\u0027s not clear that you might have more threads than this running.","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"7c3001f8940080a50d69e183c019b96fd6c9282d","unresolved":false,"context_lines":[{"line_number":94,"context_line":"| project_domain_name | Project domain name for keystone authentication | |"},{"line_number":95,"context_line":"| project_id | Keystone project id  for keystone authentication | |"},{"line_number":96,"context_line":"| check_frequency | How often to run metric collection in seconds | 60 |"},{"line_number":97,"context_line":"| num_collector_threads | Number of Threads to use in Collector for running checks | 1 |"},{"line_number":98,"context_line":"| keystone_url | This is a required parameter that specifies the url of the keystone api for retrieving tokens. It must be a v3 endpoint. | http://192.168.1.5:35357/v3 |"},{"line_number":99,"context_line":"| dimensions | A comma separated list of key:value pairs to include as dimensions in all submitted metrics| region:a,az:1 |"},{"line_number":100,"context_line":"| service | This is an optional parameter that specifies the name of the service associated with this particular node | nova, cinder, myservice |"}],"source_content_type":"text/x-markdown","patch_set":5,"id":"5a9d85d2_ae07f31a","line":97,"range":{"start_line":97,"start_character":36,"end_line":97,"end_character":43},"updated":"2016-06-21 04:04:14.000000000","message":"lowercase, IMHO. And I think there\u0027s no need for collector to be capitalized as well.","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"f266dbb1409b0d02a02698f0deb5178c81cb5b41","unresolved":false,"context_lines":[{"line_number":94,"context_line":"| project_domain_name | Project domain name for keystone authentication | |"},{"line_number":95,"context_line":"| project_id | Keystone project id  for keystone authentication | |"},{"line_number":96,"context_line":"| check_frequency | How often to run metric collection in seconds | 60 |"},{"line_number":97,"context_line":"| num_collector_threads | Number of Threads to use in Collector for running checks | 1 |"},{"line_number":98,"context_line":"| keystone_url | This is a required parameter that specifies the url of the keystone api for retrieving tokens. It must be a v3 endpoint. | http://192.168.1.5:35357/v3 |"},{"line_number":99,"context_line":"| dimensions | A comma separated list of key:value pairs to include as dimensions in all submitted metrics| region:a,az:1 |"},{"line_number":100,"context_line":"| service | This is an optional parameter that specifies the name of the service associated with this particular node | nova, cinder, myservice |"}],"source_content_type":"text/x-markdown","patch_set":5,"id":"3aaa91ec_60422540","line":97,"range":{"start_line":97,"start_character":36,"end_line":97,"end_character":43},"in_reply_to":"5a9d85d2_ae07f31a","updated":"2016-06-22 23:11:07.000000000","message":"Done","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":234,"context_line":"The monasca-setup command will create an appropriate startup script for the agent and so the agent can be run by using the standard daemon control tool for your operating system. If you have configured manually the startup script templates can be found in the code under the packaging directory."},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"# Running the collector with multiple threads"},{"line_number":237,"context_line":"The number of threads to use for running the plugins is via num_collector_threads. Setting this value to greater than 1 can be very useful when some plugins take a relatively long time to run. With num_collector_threads set to 1, the plugins are run serially. If the sum of the collection times for each plugin is greater than the check_frequency, then the metrics will not be collected as often as they should be. With more threads, the collection time is closer to the longest plugin collection time."},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"The collector is optimized for collecting as many metrics on schedule as possible. The plugins are run in reverse order of their collection time, i.e., the fastest plugin first. Also, if a plugin does not complete within the collection frequency, that plugin will be skipped in the next collection cycle. These two optimizations together ensure that plugins that complete with collection frequency seconds will get run on every collection cycle."},{"line_number":240,"context_line":""}],"source_content_type":"text/x-markdown","patch_set":10,"id":"3aaa91ec_74cd035d","line":237,"updated":"2016-06-27 20:14:10.000000000","message":"Can remove the word \u0027be\u0027.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":236,"context_line":"# Running the collector with multiple threads"},{"line_number":237,"context_line":"The number of threads to use for running the plugins is via num_collector_threads. Setting this value to greater than 1 can be very useful when some plugins take a relatively long time to run. With num_collector_threads set to 1, the plugins are run serially. If the sum of the collection times for each plugin is greater than the check_frequency, then the metrics will not be collected as often as they should be. With more threads, the collection time is closer to the longest plugin collection time."},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"The collector is optimized for collecting as many metrics on schedule as possible. The plugins are run in reverse order of their collection time, i.e., the fastest plugin first. Also, if a plugin does not complete within the collection frequency, that plugin will be skipped in the next collection cycle. These two optimizations together ensure that plugins that complete with collection frequency seconds will get run on every collection cycle."},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"If there is some problem with multiple plugins that end up blocking the entire thread pool, the collector will exit so that it can be restarted by the supervisord. The parameter pool_full_max_retries controls when this happens. If pool_full_max_retries consecutive collection cycles have ended with the Thread Pool completely full, the collector will exit."},{"line_number":242,"context_line":""}],"source_content_type":"text/x-markdown","patch_set":10,"id":"3aaa91ec_f42e13f9","line":239,"updated":"2016-06-27 20:14:10.000000000","message":"...collection time. I.e.,...","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"}],"monasca_agent/collector/checks/collector.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"63fd8aa858f2b66a5aceb5fe6ffd6408bdf308ae","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.initialized_checks_d \u003d []"},{"line_number":41,"context_line":"        self.init_failed_checks_d \u003d []"},{"line_number":42,"context_line":"        self.pool_size \u003d int(self.agent_config.get(\u0027collector_threads\u0027, 1))"},{"line_number":43,"context_line":"        self.pool \u003d None"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        if checksd:"},{"line_number":46,"context_line":"            # is of type {check_name: check}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_7b129db5","line":43,"range":{"start_line":43,"start_character":20,"end_line":43,"end_character":24},"updated":"2016-06-17 16:29:33.000000000","message":"Just wondering if you want to initialize pool at this point if num_collector_threads \u003e 1. I usually try to initialize objects to there fully constructed state.","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"63fd8aa858f2b66a5aceb5fe6ffd6408bdf308ae","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        if self.pool_size \u003d\u003d 1:"},{"line_number":98,"context_line":"            num_metrics \u003d self.run_checks_d_synchronous()"},{"line_number":99,"context_line":"        else:"},{"line_number":100,"context_line":"            num_metrics \u003d self.run_checks_d_using_threads()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        collect_duration \u003d timer.step()"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_a1133264","line":100,"range":{"start_line":100,"start_character":12,"end_line":100,"end_character":23},"updated":"2016-06-17 16:29:33.000000000","message":"Just as another design approach to consider, but would it be worth running everything in a thread, even if the pool size is 1? For example, pass in an array to what is now called run_single_check instead of the single check, and iterate over all the checks where the try block starts. In the single thread case just pass the array of all checks to run_single_check. That would reduce a bit of the code.\n\nIf you did something along those lines, then you could also start to bundle checks that we might want to run in a single thread together. Perhaps there are a bunch of checks that run really fast that can all run in the same thread, and a bunch that should run in separate threads. Not sure that is a realistic scenario, but thought I would point out.","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":11155,"name":"Ryan Bak","email":"ryan.bak@twcable.com","username":"ryanmbak"},"change_message_id":"2d372719f39c1063de77787e41708c26af266db8","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        if self.pool_size \u003d\u003d 1:"},{"line_number":98,"context_line":"            num_metrics \u003d self.run_checks_d_synchronous()"},{"line_number":99,"context_line":"        else:"},{"line_number":100,"context_line":"            num_metrics \u003d self.run_checks_d_using_threads()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        collect_duration \u003d timer.step()"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_09706c71","line":100,"range":{"start_line":100,"start_character":12,"end_line":100,"end_character":23},"in_reply_to":"7aa08908_a1133264","updated":"2016-06-17 17:32:55.000000000","message":"The thread pools do have some overhead.  It spawns, I believe, three management threads.  That said I think the consistency of always using a pool, even in the case of pool size\u003d1 is worth the small overhead.","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"63fd8aa858f2b66a5aceb5fe6ffd6408bdf308ae","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            check.stop()"},{"line_number":202,"context_line":"        if self.pool:"},{"line_number":203,"context_line":"            self.pool.close()"},{"line_number":204,"context_line":"            self.pool.join()"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_a1e97281","line":204,"range":{"start_line":204,"start_character":12,"end_line":204,"end_character":16},"updated":"2016-06-17 16:29:33.000000000","message":"Would a timeout be good to add to the join so you don\u0027t get stuck waiting on a thread that won\u0027t exit?","commit_id":"2afdbde28e35f3d3cca79bb5cdc8c9db88803eab"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"7c3001f8940080a50d69e183c019b96fd6c9282d","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self.pool_size \u003d int(self.agent_config.get(\u0027num_collector_threads\u0027, 1))"},{"line_number":47,"context_line":"        self.pool \u003d None"},{"line_number":48,"context_line":"        if self.pool_size \u003e 1:"},{"line_number":49,"context_line":"            log.info(\u0027Using %d Threads for Collector\u0027 % self.pool_size)"},{"line_number":50,"context_line":"            self.pool \u003d Pool(self.pool_size)"},{"line_number":51,"context_line":"            self.collection_times \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a9d85d2_7914b743","line":48,"range":{"start_line":48,"start_character":27,"end_line":48,"end_character":28},"updated":"2016-06-21 04:04:14.000000000","message":"I think that checking on negative (non-negative) value is in order. What if user sets 0 or -10 as num_collector_threads. Maybe that is possible to set where all program\u0027s argument are defined ?","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"d84ce6355716a008c460e304d9e073d594ee616f","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self.pool_size \u003d int(self.agent_config.get(\u0027num_collector_threads\u0027, 1))"},{"line_number":47,"context_line":"        self.pool \u003d None"},{"line_number":48,"context_line":"        if self.pool_size \u003e 1:"},{"line_number":49,"context_line":"            log.info(\u0027Using %d Threads for Collector\u0027 % self.pool_size)"},{"line_number":50,"context_line":"            self.pool \u003d Pool(self.pool_size)"},{"line_number":51,"context_line":"            self.collection_times \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a9d85d2_b6b620da","line":48,"range":{"start_line":48,"start_character":27,"end_line":48,"end_character":28},"in_reply_to":"5a9d85d2_7914b743","updated":"2016-06-21 09:59:46.000000000","message":"I think that can by done during parsing the argument. See my comment in monasca_setup/main.py","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"67a7463666fa934b01d32c3bbd9eadbceb08a317","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            for check_name in tmp_results:"},{"line_number":193,"context_line":"                result \u003d self.collection_results[check_name][\u0027result\u0027]"},{"line_number":194,"context_line":"                result.wait(wait_time)"},{"line_number":195,"context_line":"                if result.ready():"},{"line_number":196,"context_line":"                    log.debug(\u0027Plugin %s has completed\u0027 % check_name)"},{"line_number":197,"context_line":"                    count, collect_time \u003d result.get()"},{"line_number":198,"context_line":"                    measurements +\u003d count"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_911b211b","line":195,"range":{"start_line":195,"start_character":26,"end_line":195,"end_character":31},"updated":"2016-06-23 01:25:04.000000000","message":"Would we want to check the success of the thread call using ready.successful() anywhere or can we trust that the plugin will trap any errors and report?","commit_id":"c6d82c50ef693305d4afe3f80c701b9d1c996459"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"67a7463666fa934b01d32c3bbd9eadbceb08a317","unresolved":false,"context_lines":[{"line_number":252,"context_line":"            if (self.pool_full_count \u003e self.max_pool_full_count):"},{"line_number":253,"context_line":"                log.error(\u0027%d plugins are running and not progressing, exiting\u0027 %"},{"line_number":254,"context_line":"                          len(self.collection_results))"},{"line_number":255,"context_line":"                os.exit(1)"},{"line_number":256,"context_line":"        else:"},{"line_number":257,"context_line":"            self.pool_full_count \u003d 0"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_b1a45db9","line":255,"range":{"start_line":255,"start_character":19,"end_line":255,"end_character":23},"updated":"2016-06-23 01:25:04.000000000","message":"This call should be _exit(1)","commit_id":"c6d82c50ef693305d4afe3f80c701b9d1c996459"},{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"6d72ef00f9c20640a397d972775b12c4b607c293","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        measurements \u003d 0"},{"line_number":169,"context_line":"        time_left \u003d check_frequency"},{"line_number":170,"context_line":"        while time_left \u003e 0 and self.collection_results:"},{"line_number":171,"context_line":"            tmp_results \u003d dict(self.collection_results)"},{"line_number":172,"context_line":"            for check_name in tmp_results:"},{"line_number":173,"context_line":"                result \u003d self.collection_results[check_name][\u0027result\u0027]"},{"line_number":174,"context_line":"                result.wait(wait_time)"},{"line_number":175,"context_line":"                if result.ready():"}],"source_content_type":"text/x-python","patch_set":7,"id":"3aaa91ec_20c3ab8a","line":172,"range":{"start_line":171,"start_character":12,"end_line":172,"end_character":42},"updated":"2016-06-24 08:36:34.000000000","message":"Wouldn\u0027t it work with\n\nfor check_name in self.collection_results.keys()\n\n?\n\nThat way the creation of tmp_results is not necessary.","commit_id":"e37dfed3b36b874309bce90c989e4cb45755385d"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"218a425280aed2fc7aca3a3b1cd9ef9464b726f0","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        measurements \u003d 0"},{"line_number":169,"context_line":"        time_left \u003d check_frequency"},{"line_number":170,"context_line":"        while time_left \u003e 0 and self.collection_results:"},{"line_number":171,"context_line":"            tmp_results \u003d dict(self.collection_results)"},{"line_number":172,"context_line":"            for check_name in tmp_results:"},{"line_number":173,"context_line":"                result \u003d self.collection_results[check_name][\u0027result\u0027]"},{"line_number":174,"context_line":"                result.wait(wait_time)"},{"line_number":175,"context_line":"                if result.ready():"}],"source_content_type":"text/x-python","patch_set":7,"id":"3aaa91ec_4daee081","line":172,"range":{"start_line":171,"start_character":12,"end_line":172,"end_character":42},"in_reply_to":"3aaa91ec_20c3ab8a","updated":"2016-06-24 14:04:20.000000000","message":"Since I am deleting from self.collection_results, I can\u0027t just use self.collection_results.keys(), but I can use:\n\nfor check_name in list(self.collection_results.keys()):\n\nWill make that change","commit_id":"e37dfed3b36b874309bce90c989e4cb45755385d"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"e5252fca8f63da07b320ca925a21340e0d962fbb","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # Warn if collection time is approaching the collection period"},{"line_number":105,"context_line":"        if collect_duration \u003e (4 * check_frequency / 5):"},{"line_number":106,"context_line":"            log.info(\"Collection time (s) is high: %.1f, metrics count: %d\" %"},{"line_number":107,"context_line":"                     (collect_duration, num_metrics))"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        self.collector_stats(num_metrics, collect_duration)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_2a29a89e","line":106,"range":{"start_line":106,"start_character":20,"end_line":106,"end_character":22},"updated":"2016-06-24 20:16:30.000000000","message":"Should this be log.warn?","commit_id":"50c731b6659592bb84fa4956efba879691205acd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"429b1e8c914394772dad7f2e0824df5ebd07ac75","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # Warn if collection time is approaching the collection period"},{"line_number":105,"context_line":"        if collect_duration \u003e (4 * check_frequency / 5):"},{"line_number":106,"context_line":"            log.info(\"Collection time (s) is high: %.1f, metrics count: %d\" %"},{"line_number":107,"context_line":"                     (collect_duration, num_metrics))"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        self.collector_stats(num_metrics, collect_duration)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_49987f1c","line":106,"range":{"start_line":106,"start_character":20,"end_line":106,"end_character":22},"in_reply_to":"3aaa91ec_2a29a89e","updated":"2016-06-24 21:46:26.000000000","message":"Done","commit_id":"50c731b6659592bb84fa4956efba879691205acd"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.collection_metrics \u003d {}"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        # is of type {check_name: check}"},{"line_number":43,"context_line":"        initialized_checks_d \u003d checksd[\u0027initialized_checks\u0027]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.pool_size \u003d int(self.agent_config.get(\u0027num_collector_threads\u0027, 1))"},{"line_number":46,"context_line":"        log.info(\u0027Using %d Threads for Collector\u0027 % self.pool_size)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_54e727ac","line":43,"updated":"2016-06-27 20:14:10.000000000","message":"Not sure how careful you want to be, but you might want to check for the existence of \u0027initialized_checks\u0027 first then set to default if DNE and log warning.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        initialized_checks_d \u003d checksd[\u0027initialized_checks\u0027]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.pool_size \u003d int(self.agent_config.get(\u0027num_collector_threads\u0027, 1))"},{"line_number":46,"context_line":"        log.info(\u0027Using %d Threads for Collector\u0027 % self.pool_size)"},{"line_number":47,"context_line":"        self.pool \u003d Pool(self.pool_size)"},{"line_number":48,"context_line":"        self.pool_full_count \u003d 0"},{"line_number":49,"context_line":"        self.collection_times \u003d {}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_b4a64b51","line":46,"updated":"2016-06-27 20:14:10.000000000","message":"Should prefer .format to % templates.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                      (self.run_count, round(collect_duration, 2),))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def add_collection_metric(self, name, value):"},{"line_number":80,"context_line":"        self.collection_metrics[name] \u003d value"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def collector_stats(self, num_metrics, collection_time):"},{"line_number":83,"context_line":"        thread_count \u003d threading.active_count()"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_5411e75c","line":80,"updated":"2016-06-27 20:14:10.000000000","message":"What if item already exists?","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        collect_duration \u003d timer.step()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # Warn if collection time is approaching the collection period"},{"line_number":105,"context_line":"        if collect_duration \u003e (4 * check_frequency / 5):"},{"line_number":106,"context_line":"            log.warn(\"Collection time (s) is high: %.1f, metrics count: %d\" %"},{"line_number":107,"context_line":"                     (collect_duration, num_metrics))"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_ef02c008","line":105,"updated":"2016-06-27 20:14:10.000000000","message":"Comment explaining this calculation would help maintainers.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\"Wait either for all running checks to finish or"},{"line_number":161,"context_line":"        for check_frequency seconds, whichever comes first"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        returns number of measurements collected"},{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # Make sure we check for results at least once"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_cf4a6455","line":163,"updated":"2016-06-27 20:14:10.000000000","message":"returns should have a colons beforeafter it. \u0027:returns:\u0027","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # Make sure we check for results at least once"},{"line_number":167,"context_line":"        wait_time \u003d check_frequency / 10"},{"line_number":168,"context_line":"        measurements \u003d 0"},{"line_number":169,"context_line":"        time_left \u003d check_frequency"},{"line_number":170,"context_line":"        while time_left \u003e 0 and self.collection_results:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_4f6dd4cb","line":167,"updated":"2016-06-27 20:14:10.000000000","message":"Comment explaining 10 would help maintainers.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"5f5d2aff3f523bf31b1df923225f04812d00182a","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        # Sort by the last collection time so the checks that take the"},{"line_number":193,"context_line":"        # least amount of time are run first so they are more likely to"},{"line_number":194,"context_line":"        # complete within the check_frequency"},{"line_number":195,"context_line":"        sorted_checks \u003d sorted(self.collection_times.itervalues(),"},{"line_number":196,"context_line":"                               key\u003dlambda x: x[\u0027last_collect_time\u0027])"},{"line_number":197,"context_line":"        for entry in sorted_checks:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_0f810c4e","line":194,"updated":"2016-06-27 20:14:10.000000000","message":"These doc strings should conform to http://docs.openstack.org/developer/hacking/.","commit_id":"3248ea503e5da0620748f93d0d8fd4e589f28e10"}],"monasca_setup/main.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"7c3001f8940080a50d69e183c019b96fd6c9282d","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                                       \"plugins. Only certain detection plugins use arguments.\")"},{"line_number":195,"context_line":"    parser.add_argument(\u0027--check_frequency\u0027, help\u003d\"How often to run metric collection in seconds\", type\u003dint, default\u003d30)"},{"line_number":196,"context_line":"    parser.add_argument(\u0027--num_collector_threads\u0027, help\u003d\"Number of Threads to use in Collector \" +"},{"line_number":197,"context_line":"                                                        \"for running checks\", default\u003d1)"},{"line_number":198,"context_line":"    parser.add_argument(\u0027--dimensions\u0027, help\u003d\"Additional dimensions to set for all metrics. A comma separated list \" +"},{"line_number":199,"context_line":"                                             \"of name/value pairs, \u0027name:value,name2:value2\u0027\")"},{"line_number":200,"context_line":"    parser.add_argument(\u0027--ca_file\u0027, help\u003d\"Sets the path to the ca certs file if using certificates. \" +"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a9d85d2_39218fa0","line":197,"range":{"start_line":197,"start_character":78,"end_line":197,"end_character":85},"updated":"2016-06-21 04:04:14.000000000","message":"I think that \n\n type\u003dint\n\ncan be added here, that would allow you to skip casting to int in other file. See \n\n --check_frequency\n\ndefinition above.","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"30235e6050d7cb625463ad039acc4c03e555c7a9","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                                       \"plugins. Only certain detection plugins use arguments.\")"},{"line_number":195,"context_line":"    parser.add_argument(\u0027--check_frequency\u0027, help\u003d\"How often to run metric collection in seconds\", type\u003dint, default\u003d30)"},{"line_number":196,"context_line":"    parser.add_argument(\u0027--num_collector_threads\u0027, help\u003d\"Number of Threads to use in Collector \" +"},{"line_number":197,"context_line":"                                                        \"for running checks\", default\u003d1)"},{"line_number":198,"context_line":"    parser.add_argument(\u0027--dimensions\u0027, help\u003d\"Additional dimensions to set for all metrics. A comma separated list \" +"},{"line_number":199,"context_line":"                                             \"of name/value pairs, \u0027name:value,name2:value2\u0027\")"},{"line_number":200,"context_line":"    parser.add_argument(\u0027--ca_file\u0027, help\u003d\"Sets the path to the ca certs file if using certificates. \" +"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_6835e7f5","line":197,"range":{"start_line":197,"start_character":78,"end_line":197,"end_character":85},"in_reply_to":"3aaa91ec_20581d32","updated":"2016-06-23 04:19:23.000000000","message":"If any callable would do here, lamba should be sufficient to verify if supplied value is positive number. Or maybe there\u0027s an actual validator already in parser module for that.","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"f266dbb1409b0d02a02698f0deb5178c81cb5b41","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                                       \"plugins. Only certain detection plugins use arguments.\")"},{"line_number":195,"context_line":"    parser.add_argument(\u0027--check_frequency\u0027, help\u003d\"How often to run metric collection in seconds\", type\u003dint, default\u003d30)"},{"line_number":196,"context_line":"    parser.add_argument(\u0027--num_collector_threads\u0027, help\u003d\"Number of Threads to use in Collector \" +"},{"line_number":197,"context_line":"                                                        \"for running checks\", default\u003d1)"},{"line_number":198,"context_line":"    parser.add_argument(\u0027--dimensions\u0027, help\u003d\"Additional dimensions to set for all metrics. A comma separated list \" +"},{"line_number":199,"context_line":"                                             \"of name/value pairs, \u0027name:value,name2:value2\u0027\")"},{"line_number":200,"context_line":"    parser.add_argument(\u0027--ca_file\u0027, help\u003d\"Sets the path to the ca certs file if using certificates. \" +"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_20581d32","line":197,"range":{"start_line":197,"start_character":78,"end_line":197,"end_character":85},"in_reply_to":"5a9d85d2_196e4596","updated":"2016-06-22 23:11:07.000000000","message":"Good ideas, I will do that soon","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"d84ce6355716a008c460e304d9e073d594ee616f","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                                       \"plugins. Only certain detection plugins use arguments.\")"},{"line_number":195,"context_line":"    parser.add_argument(\u0027--check_frequency\u0027, help\u003d\"How often to run metric collection in seconds\", type\u003dint, default\u003d30)"},{"line_number":196,"context_line":"    parser.add_argument(\u0027--num_collector_threads\u0027, help\u003d\"Number of Threads to use in Collector \" +"},{"line_number":197,"context_line":"                                                        \"for running checks\", default\u003d1)"},{"line_number":198,"context_line":"    parser.add_argument(\u0027--dimensions\u0027, help\u003d\"Additional dimensions to set for all metrics. A comma separated list \" +"},{"line_number":199,"context_line":"                                             \"of name/value pairs, \u0027name:value,name2:value2\u0027\")"},{"line_number":200,"context_line":"    parser.add_argument(\u0027--ca_file\u0027, help\u003d\"Sets the path to the ca certs file if using certificates. \" +"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a9d85d2_196e4596","line":197,"range":{"start_line":197,"start_character":78,"end_line":197,"end_character":85},"in_reply_to":"5a9d85d2_39218fa0","updated":"2016-06-21 09:59:46.000000000","message":"I agree.I think you can check here if the number is no negative (\u003e0), use action for this. For example:\n\n action\u003dValidateThreadsNumber","commit_id":"116decb5bbe30eff6866c6e18bd889b39b5ad50c"}]}
