)]}'
{"watcher/decision_engine/model/collector/nova.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"10f6915cf9edcb0636320b34561457c83b311821","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        builder \u003d ModelBuilder(self.osc)"},{"line_number":187,"context_line":"        with timeutils.StopWatch() as timer:"},{"line_number":188,"context_line":"            model \u003d builder.execute(self._data_model_scope)"},{"line_number":189,"context_line":"        LOG.debug(\u0027Took %0.2f seconds build nova CDM\u0027, timer.elapsed())"},{"line_number":190,"context_line":"        return model"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_316879b7","line":189,"updated":"2019-05-15 01:03:49.000000000","message":"Here is an example:\n\nhttp://logs.openstack.org/83/659183/1/check/watcher-tempest-actuator/27104be/controller/logs/screen-watcher-decision-engine.txt.gz#_May_14_23_54_41_941732\n\nMay 14 23:54:41.941732 ubuntu-bionic-ovh-bhs1-0006154632 watcher-decision-engine[2907]: DEBUG watcher.decision_engine.model.collector.nova [None req-ed1e645d-14f2-4142-a00c-8f5e64f4facf None None] Took 0.67 seconds build nova CDM {{(pid\u003d2907) execute /opt/stack/watcher/watcher/decision_engine/model/collector/nova.py:189}}","commit_id":"eef7e60d86e491c8eb226ccd0e56052ed6dff551"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fb86c2b3c0dbacbb001000b716b47f02892f26a5","unresolved":false,"context_lines":[{"line_number":252,"context_line":"            if service.zone in zone_names or include_all_nodes:"},{"line_number":253,"context_line":"                _nodes.add(service.host)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    # TODO(mriedem): Consider adding a dedicated config option to enable"},{"line_number":256,"context_line":"    # profiling (or integrate osprofiler)."},{"line_number":257,"context_line":"    @timeutils.time_it(LOG, enabled\u003dCONF.debug)"},{"line_number":258,"context_line":"    def _add_physical_layer(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_56c963a9","line":255,"updated":"2019-05-14 23:12:42.000000000","message":"I could see us also adding a custom timer which could use a configuration option that logs a warning if a given operation takes longer than a certain threshold, so if for example it takes over 10 seconds to list availability zones.","commit_id":"eef7e60d86e491c8eb226ccd0e56052ed6dff551"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"10f6915cf9edcb0636320b34561457c83b311821","unresolved":false,"context_lines":[{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    # TODO(mriedem): Consider adding a dedicated config option to enable"},{"line_number":256,"context_line":"    # profiling (or integrate osprofiler)."},{"line_number":257,"context_line":"    @timeutils.time_it(LOG, enabled\u003dCONF.debug)"},{"line_number":258,"context_line":"    def _add_physical_layer(self):"},{"line_number":259,"context_line":"        \"\"\"Add the physical layer of the graph."},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_f15d0115","line":257,"updated":"2019-05-15 01:03:49.000000000","message":"Example of this:\n\nhttp://logs.openstack.org/83/659183/1/check/watcher-tempest-actuator/27104be/controller/logs/screen-watcher-decision-engine.txt.gz#_May_14_23_54_41_940148\n\nMay 14 23:54:41.940148 ubuntu-bionic-ovh-bhs1-0006154632 watcher-decision-engine[2907]: DEBUG watcher.decision_engine.model.collector.nova [None req-ed1e645d-14f2-4142-a00c-8f5e64f4facf None None] It took 0.67 seconds to run function \u0027watcher.decision_engine.model.collector.nova._add_physical_layer\u0027 {{(pid\u003d2907) wrapper /usr/local/lib/python2.7/dist-packages/oslo_utils/timeutils.py:391}}","commit_id":"eef7e60d86e491c8eb226ccd0e56052ed6dff551"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"13e4f8bf1f24a7bae1e0a4b7e2e63761617129ef","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        if instances is None:"},{"line_number":372,"context_line":"            # no instances on this node"},{"line_number":373,"context_line":"            return"},{"line_number":374,"context_line":"        # TODO(mriedem): Rather than get details per server with separate"},{"line_number":375,"context_line":"        # API calls, just do GET /servers/detail?host\u003dnode.service[\"host\"]"},{"line_number":376,"context_line":"        instance_uuids \u003d [s[\u0027uuid\u0027] for s in instances]"},{"line_number":377,"context_line":"        for uuid in instance_uuids:"},{"line_number":378,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_dc11ad55","line":375,"range":{"start_line":374,"start_character":8,"end_line":375,"end_character":74},"updated":"2019-05-16 21:52:35.000000000","message":"Note we can do this with python-novaclient today, we just pass in our own search_opts dict. One difference is that if the nova_client configured user for watcher does not have admin access to nova the host filter will be ignored and we could either get back nothing or way more than we wanted, but since we can list hypervisors and get details on hypervisors it\u0027s probably a safe assumption that we have admin access to list servers and filter by host.","commit_id":"eef7e60d86e491c8eb226ccd0e56052ed6dff551"}]}
