)]}'
{"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8f8c247837bf188693fc43463e94a40f43077a","unresolved":false,"context_lines":[{"line_number":4638,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4639,"context_line":"                cell_stats.append(self.db.compute_node_statistics(cctxt))"},{"line_number":4640,"context_line":""},{"line_number":4641,"context_line":"        keys \u003d cell_stats[0].keys()"},{"line_number":4642,"context_line":"        return {k: sum(stats[k] for stats in cell_stats)"},{"line_number":4643,"context_line":"                for k in keys}"},{"line_number":4644,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f231b9d_2f05b914","line":4641,"range":{"start_line":4641,"start_character":25,"end_line":4641,"end_character":28},"updated":"2017-06-14 15:14:53.000000000","message":"What if we have no cells yet? Or just had cell0 at this point?","commit_id":"567d70f22ae95589b23a25a97b05754889e852f1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4ea9f81e3cac8309690971cb1c34eb3e202ab87f","unresolved":false,"context_lines":[{"line_number":4638,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4639,"context_line":"                cell_stats.append(self.db.compute_node_statistics(cctxt))"},{"line_number":4640,"context_line":""},{"line_number":4641,"context_line":"        keys \u003d cell_stats[0].keys()"},{"line_number":4642,"context_line":"        return {k: sum(stats[k] for stats in cell_stats)"},{"line_number":4643,"context_line":"                for k in keys}"},{"line_number":4644,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f231b9d_ed958634","line":4641,"range":{"start_line":4641,"start_character":25,"end_line":4641,"end_character":28},"in_reply_to":"7f231b9d_2f05b914","updated":"2017-06-14 17:08:23.000000000","message":"I was actually going to do this:\n\n if not cell_stats:\n   return {}\n\nand forgot.","commit_id":"567d70f22ae95589b23a25a97b05754889e852f1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8e3f47706b15cdc630d9da8a034ad945ca9a55af","unresolved":false,"context_lines":[{"line_number":4638,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4639,"context_line":"                cell_stats.append(self.db.compute_node_statistics(cctxt))"},{"line_number":4640,"context_line":""},{"line_number":4641,"context_line":"        keys \u003d cell_stats[0].keys()"},{"line_number":4642,"context_line":"        return {k: sum(stats[k] for stats in cell_stats)"},{"line_number":4643,"context_line":"                for k in keys}"},{"line_number":4644,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f231b9d_cd6acaeb","line":4641,"range":{"start_line":4641,"start_character":25,"end_line":4641,"end_character":28},"in_reply_to":"7f231b9d_cdce4a2c","updated":"2017-06-14 19:13:07.000000000","message":"Well, it\u0027s not currently, and really shouldn\u0027t ever be, since that would change the output of the api. It\u0027s been the same set of stats for a long time I think. Also, returning stats that include some values sum\u0027d over all cells, and other stats that are just one cell would be confusing I think.\n\nImagine if we added a cpu_threads thing, you could end up with 4 threads and 64 cores, which wouldn\u0027t make any sense, just because the other cells weren\u0027t reporting.\n\nThis interface probably needs some re-thinking and schema validation anyway...","commit_id":"567d70f22ae95589b23a25a97b05754889e852f1"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"d8a05c923543732d36449e04c05b8a2c73bce05d","unresolved":false,"context_lines":[{"line_number":4638,"context_line":"            with nova_context.target_cell(context, cell) as cctxt:"},{"line_number":4639,"context_line":"                cell_stats.append(self.db.compute_node_statistics(cctxt))"},{"line_number":4640,"context_line":""},{"line_number":4641,"context_line":"        keys \u003d cell_stats[0].keys()"},{"line_number":4642,"context_line":"        return {k: sum(stats[k] for stats in cell_stats)"},{"line_number":4643,"context_line":"                for k in keys}"},{"line_number":4644,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f231b9d_cdce4a2c","line":4641,"range":{"start_line":4641,"start_character":25,"end_line":4641,"end_character":28},"in_reply_to":"7f231b9d_ed958634","updated":"2017-06-14 17:17:31.000000000","message":"+1\nI\u0027m not sure if it\u0027s possible to have different statistics keys from different cells, probably it\u0027s safer to use something like:\n\ntotal_stat \u003d {}\nfor stat in cell_stats:\n    for key in stat:\n        if key not in total_stat:\n            total_stat[key] \u003d 0\n        total_stat[key] +\u003d stat[key]","commit_id":"567d70f22ae95589b23a25a97b05754889e852f1"}],"nova/tests/unit/compute/test_host_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8f8c247837bf188693fc43463e94a40f43077a","unresolved":false,"context_lines":[{"line_number":428,"context_line":"            {\u0027stat1\u0027: 1, \u0027stat2\u0027: 4.0},"},{"line_number":429,"context_line":"            {\u0027stat1\u0027: 5, \u0027stat2\u0027: 1.2},"},{"line_number":430,"context_line":"        ]"},{"line_number":431,"context_line":"        compute_api.CELLS \u003d [objects.CellMapping(uuid\u003duuids.cell1),"},{"line_number":432,"context_line":"                             objects.CellMapping(uuid\u003duuids.cell2)]"},{"line_number":433,"context_line":"        stats \u003d self.host_api.compute_node_statistics(self.ctxt)"},{"line_number":434,"context_line":"        self.assertEqual({\u0027stat1\u0027: 6, \u0027stat2\u0027: 5.2}, stats)"},{"line_number":435,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f231b9d_da7cc584","line":432,"range":{"start_line":431,"start_character":29,"end_line":432,"end_character":65},"updated":"2017-06-14 15:14:53.000000000","message":"Let\u0027s throw a cell0 in here to make sure it\u0027s skipped.","commit_id":"567d70f22ae95589b23a25a97b05754889e852f1"}]}
