)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"ef4d5cd17d4d46c46efd75f570ef60ac5f191ada","unresolved":false,"context_lines":[{"line_number":15,"context_line":"* zuul.nodepool.resources.tenant.{tenant}.{resource}.current"},{"line_number":16,"context_line":"  Gauge with the currently used resources by tenant"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"* zuul.nodepool.resources.tenant.{project}.{resource}.current"},{"line_number":19,"context_line":"  Gauge with the currently used resources by project"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"* zuul.nodepool.resources.tenant.{tenant}.{resource}.counter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3f79a3b5_69927ffc","line":18,"range":{"start_line":18,"start_character":26,"end_line":18,"end_character":31},"updated":"2018-12-20 14:06:24.000000000","message":"project","commit_id":"8d9874212b82424badc34cfe504cd761af29fb57"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"b732cde7942eac6dff4d2b3a180f8c61f818040c","unresolved":false,"context_lines":[{"line_number":15,"context_line":"* zuul.nodepool.resources.tenant.{tenant}.{resource}.current"},{"line_number":16,"context_line":"  Gauge with the currently used resources by tenant"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"* zuul.nodepool.resources.tenant.{project}.{resource}.current"},{"line_number":19,"context_line":"  Gauge with the currently used resources by project"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"* zuul.nodepool.resources.tenant.{tenant}.{resource}.counter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3f79a3b5_14543ef0","line":18,"range":{"start_line":18,"start_character":26,"end_line":18,"end_character":31},"in_reply_to":"3f79a3b5_69927ffc","updated":"2018-12-20 14:17:22.000000000","message":"Done","commit_id":"8d9874212b82424badc34cfe504cd761af29fb57"}],"doc/source/admin/monitoring.rst":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"b882d4990b7310f442ac9dc97133e425567c02ce","unresolved":false,"context_lines":[{"line_number":286,"context_line":"         .. stat:: \u003ctenant\u003e.\u003cresource\u003e.counter"},{"line_number":287,"context_line":"            :type: counter"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"            Counter with the summed usage by tenant as \u003cresource\u003e seconds."},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"      .. stat:: project"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_71b06b42","line":289,"updated":"2018-12-04 18:51:34.000000000","message":"With statsd, I don\u0027t think we need separate current/counter keys -- they have different statsd roots.  So we could just put them under one key and note that they are gauge/counter types.","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"df9d8a08fcbef0045dec7aec8d23eb3b895e9fcb","unresolved":false,"context_lines":[{"line_number":286,"context_line":"         .. stat:: \u003ctenant\u003e.\u003cresource\u003e.counter"},{"line_number":287,"context_line":"            :type: counter"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"            Counter with the summed usage by tenant as \u003cresource\u003e seconds."},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"      .. stat:: project"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_d29cdebf","line":289,"in_reply_to":"3f79a3b5_71b06b42","updated":"2018-12-04 20:17:09.000000000","message":"Ok, I can change that. I just have to note that this crashes statsd_exporter if you have no special mathing rules (as those metrics arrive under the same path there). It\u0027s just graphite that separates them by default.\n\nBut since https://github.com/prometheus/statsd_exporter/pull/136 we can get around this.","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"f16a01e1615d4e3242a46fc8e828c929b208e035","unresolved":false,"context_lines":[{"line_number":286,"context_line":"         .. stat:: \u003ctenant\u003e.\u003cresource\u003e.counter"},{"line_number":287,"context_line":"            :type: counter"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"            Counter with the summed usage by tenant as \u003cresource\u003e seconds."},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"      .. stat:: project"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_bdd54e4a","line":289,"in_reply_to":"3f79a3b5_d29cdebf","updated":"2018-12-06 07:34:50.000000000","message":"Done","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"b882d4990b7310f442ac9dc97133e425567c02ce","unresolved":false,"context_lines":[{"line_number":300,"context_line":"         .. stat:: \u003cproject\u003e.\u003cresource\u003e.counter"},{"line_number":301,"context_line":"            :type: counter"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            Counter with the summed usage by project as \u003cresource\u003e seconds."},{"line_number":304,"context_line":""},{"line_number":305,"context_line":".. stat:: zuul.mergers"},{"line_number":306,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_91abc7d2","line":303,"updated":"2018-12-04 18:51:34.000000000","message":"Same.","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"f16a01e1615d4e3242a46fc8e828c929b208e035","unresolved":false,"context_lines":[{"line_number":300,"context_line":"         .. stat:: \u003cproject\u003e.\u003cresource\u003e.counter"},{"line_number":301,"context_line":"            :type: counter"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            Counter with the summed usage by project as \u003cresource\u003e seconds."},{"line_number":304,"context_line":""},{"line_number":305,"context_line":".. stat:: zuul.mergers"},{"line_number":306,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f79a3b5_ddd28a5f","line":303,"in_reply_to":"3f79a3b5_91abc7d2","updated":"2018-12-06 07:34:50.000000000","message":"Done","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"46b7167a56600f5214b19310d87b9f9b31d60a77","unresolved":false,"context_lines":[{"line_number":279,"context_line":""},{"line_number":280,"context_line":"         Holds resource usage metrics by project."},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"         .. stat:: \u003cproject\u003e.\u003cresource\u003e"},{"line_number":283,"context_line":"            :type: counter, gauge"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"            Counter with the summed usage by project as \u003cresource\u003e seconds and"}],"source_content_type":"text/x-rst","patch_set":13,"id":"9fdfeff1_ff445d1b","line":282,"updated":"2019-02-08 00:15:38.000000000","message":"Do we need to scope projects by tenant? I think there may be possibility of project collisions between tenants so not scoping projects by tenant could result in data loss/mixups.","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"91ce52a13f651942a3f2067121523141a8597ebf","unresolved":false,"context_lines":[{"line_number":279,"context_line":""},{"line_number":280,"context_line":"         Holds resource usage metrics by project."},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"         .. stat:: \u003cproject\u003e.\u003cresource\u003e"},{"line_number":283,"context_line":"            :type: counter, gauge"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"            Counter with the summed usage by project as \u003cresource\u003e seconds and"}],"source_content_type":"text/x-rst","patch_set":13,"id":"9fdfeff1_ac4788bc","line":282,"updated":"2019-02-08 16:47:13.000000000","message":"Projects can be in multiple tenants.  They are most likely to only trigger jobs in a single tenant, but not necessarily (for example, a project might be gated in one tenant, but be in a third-party-check pipeline in another).\n\nI think these two hierarchies represent the best way of dealing with this.  The tenant hierarchy tells you how much a complete tenant \"costs\", the project hierarchy tells you how much it \"costs\" to have that project in the system, even though it may be incurring usage across multiple tenants.  Either way, these both seem correct.","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"5a64543224229b8c1819392d07bde3e931e41a9a","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            :type: counter, gauge"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"            Counter with the summed usage by project as \u003cresource\u003e seconds and"},{"line_number":286,"context_line":"            gauge with the currently used resources by tenant."},{"line_number":287,"context_line":""},{"line_number":288,"context_line":""},{"line_number":289,"context_line":".. stat:: zuul.mergers"}],"source_content_type":"text/x-rst","patch_set":15,"id":"bfb3d3c7_db37c1fe","line":286,"range":{"start_line":286,"start_character":55,"end_line":286,"end_character":61},"updated":"2019-05-28 21:55:08.000000000","message":"Nit: should be project.","commit_id":"4cb6a33c1e3c99f0a5bacfd6a2249b6f08c30839"}],"releasenotes/notes/resource-usage-stats-bfcd6765ef4a9c86.yaml":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"17a49264f3f11b0fe3a35a05abf07dec7fbb1100","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Zuul now reports resource usage statistics if they are provided by nodepool."},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    The following statistics are emitted:"},{"line_number":7,"context_line":" "},{"line_number":8,"context_line":"    - `zuul.nodepool.resources.tenant.{tenant}.{resource}.current`:"},{"line_number":9,"context_line":"      Gauge with the currently used resources by tenant"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3f79a3b5_33713fac","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":1},"updated":"2018-11-26 19:53:23.000000000","message":"Trailing whitespace","commit_id":"25016f81e75f330247acb91c6cf8651816f156a3"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"ef4d5cd17d4d46c46efd75f570ef60ac5f191ada","unresolved":false,"context_lines":[{"line_number":9,"context_line":"      Gauge with the currently used resources by tenant and counter with the"},{"line_number":10,"context_line":"      summed usage by tenant. e.g. cpu seconds"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    - `zuul.nodepool.resources.tenant.{project}.{resource}`:"},{"line_number":13,"context_line":"      Gauge with the currently used resources by project and counter with the"},{"line_number":14,"context_line":"      summed usage by tenant. e.g. cpu seconds"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"3f79a3b5_09ee6b83","line":12,"range":{"start_line":12,"start_character":31,"end_line":12,"end_character":37},"updated":"2018-12-20 14:06:24.000000000","message":"project","commit_id":"8d9874212b82424badc34cfe504cd761af29fb57"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"b732cde7942eac6dff4d2b3a180f8c61f818040c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"      Gauge with the currently used resources by tenant and counter with the"},{"line_number":10,"context_line":"      summed usage by tenant. e.g. cpu seconds"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    - `zuul.nodepool.resources.tenant.{project}.{resource}`:"},{"line_number":13,"context_line":"      Gauge with the currently used resources by project and counter with the"},{"line_number":14,"context_line":"      summed usage by tenant. e.g. cpu seconds"}],"source_content_type":"text/x-yaml","patch_set":12,"id":"3f79a3b5_b4922aab","line":12,"range":{"start_line":12,"start_character":31,"end_line":12,"end_character":37},"in_reply_to":"3f79a3b5_09ee6b83","updated":"2018-12-20 14:17:22.000000000","message":"Done","commit_id":"8d9874212b82424badc34cfe504cd761af29fb57"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"91ce52a13f651942a3f2067121523141a8597ebf","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    - `zuul.nodepool.resources.project.{project}.{resource}`:"},{"line_number":13,"context_line":"      Gauge with the currently used resources by project and counter with the"},{"line_number":14,"context_line":"      summed usage by tenant. e.g. cpu seconds"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"9fdfeff1_cc420cac","line":14,"updated":"2019-02-08 16:47:13.000000000","message":"Should this say \u0027tenant\u0027 here, or project?","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"e0c78c4eec90a20a5dbf632dcecfe8fc9fafb6b2","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"    - `zuul.nodepool.resources.project.{project}.{resource}`:"},{"line_number":13,"context_line":"      Gauge with the currently used resources by project and counter with the"},{"line_number":14,"context_line":"      summed usage by tenant. e.g. cpu seconds"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"9fdfeff1_ac20e8f8","line":14,"in_reply_to":"9fdfeff1_cc420cac","updated":"2019-02-08 16:59:00.000000000","message":"good catch, of course that should be project","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"}],"zuul/nodepool.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"291a1af92b821220e4469f60811870018e6e6990","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        statsd \u003d self.sched.statsd"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for tenant, resources in self.current_resources_by_tenant.items():"},{"line_number":78,"context_line":"            for resource, value in resources:"},{"line_number":79,"context_line":"                key \u003d \u0027zuul.nodepool.resources.tenant.\u0027 \\"},{"line_number":80,"context_line":"                      \u0027{tenant}.{resource}.current\u0027"},{"line_number":81,"context_line":"                statsd.gauge(key, value, tenant\u003dtenant, resource\u003dresource)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_db4ee76b","line":78,"range":{"start_line":78,"start_character":35,"end_line":78,"end_character":45},"updated":"2018-11-08 14:24:54.000000000","message":"missing .items()","commit_id":"1d86cce00f8910135fad21da153f7d49a9925b53"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"291a1af92b821220e4469f60811870018e6e6990","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                      \u0027{tenant}.{resource}.current\u0027"},{"line_number":81,"context_line":"                statsd.gauge(key, value, tenant\u003dtenant, resource\u003dresource)"},{"line_number":82,"context_line":"        for project, resources in self.current_resources_by_project.items():"},{"line_number":83,"context_line":"            for resource, value in resources:"},{"line_number":84,"context_line":"                key \u003d \u0027zuul.nodepool.resources.project.\u0027 \\"},{"line_number":85,"context_line":"                      \u0027{project}.{resource}.current\u0027"},{"line_number":86,"context_line":"                statsd.gauge(key, value, project\u003dproject, resource\u003dresource)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_fb51630d","line":83,"range":{"start_line":83,"start_character":35,"end_line":83,"end_character":45},"updated":"2018-11-08 14:24:54.000000000","message":"dito","commit_id":"1d86cce00f8910135fad21da153f7d49a9925b53"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"17a49264f3f11b0fe3a35a05abf07dec7fbb1100","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            build.build_set.item.change and"},{"line_number":200,"context_line":"            build.build_set.item.change.project):"},{"line_number":201,"context_line":"            duration \u003d build.end_time - build.start_time"},{"line_number":202,"context_line":"            project \u003d build.build_set.item.change.project"},{"line_number":203,"context_line":"            tenant \u003d build.build_set.item.pipeline.tenant.name"},{"line_number":204,"context_line":"            self.log.info(\"Nodeset %s with %s nodes was in use \""},{"line_number":205,"context_line":"                          \"for %s seconds for build %s for project %s\","},{"line_number":206,"context_line":"                          nodeset, len(nodeset.nodes), duration, build,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_d336cbdf","line":203,"range":{"start_line":202,"start_character":0,"end_line":203,"end_character":62},"updated":"2018-11-26 19:53:23.000000000","message":"Get tenant and project independent of start and end time. They are needed in any case if build is not None.","commit_id":"25016f81e75f330247acb91c6cf8651816f156a3"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"17a49264f3f11b0fe3a35a05abf07dec7fbb1100","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        self._unlockNodes(nodeset.getNodes())"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        # When returning a nodeset we need to update the gauges if we have a"},{"line_number":224,"context_line":"        # build. Further we calculate resource^duration and increment their"},{"line_number":225,"context_line":"        # tenant or project specific counters. With that we have both the"},{"line_number":226,"context_line":"        # current value and also counters to be able to perform accounting."},{"line_number":227,"context_line":"        if tenant and project and duration:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_33237fac","line":224,"range":{"start_line":224,"start_character":46,"end_line":224,"end_character":47},"updated":"2018-11-26 19:53:23.000000000","message":"resource\u0026duration","commit_id":"25016f81e75f330247acb91c6cf8651816f156a3"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"17a49264f3f11b0fe3a35a05abf07dec7fbb1100","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        # current value and also counters to be able to perform accounting."},{"line_number":227,"context_line":"        if tenant and project and duration:"},{"line_number":228,"context_line":"            project_name \u003d project.canonical_name"},{"line_number":229,"context_line":"            subtract_resources("},{"line_number":230,"context_line":"                self.current_resources_by_tenant[tenant], resources)"},{"line_number":231,"context_line":"            subtract_resources("},{"line_number":232,"context_line":"                self.current_resources_by_project[project_name], resources)"},{"line_number":233,"context_line":"            self.emitStatsResources()"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"            self.emitStatsResourceCounters("},{"line_number":236,"context_line":"                tenant, project_name, resources, duration)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_33485f60","line":233,"range":{"start_line":229,"start_character":0,"end_line":233,"end_character":37},"updated":"2018-11-26 19:53:23.000000000","message":"This must be independent from duration. Otherwise the stats will get an offset for every aborted build.","commit_id":"25016f81e75f330247acb91c6cf8651816f156a3"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"da808d77dcf38c51f95cc89490bfc4bead7225d9","unresolved":false,"context_lines":[{"line_number":15,"context_line":"from zuul import model"},{"line_number":16,"context_line":"from zuul.zk import LockException"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def add_resources(target, source):"},{"line_number":20,"context_line":"    for key, value in source.items():"},{"line_number":21,"context_line":"        if key in target:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_f93fa820","line":18,"updated":"2018-12-03 16:14:29.000000000","message":"I wonder if collections.defaultdict would be a good thing to use here ?","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"f16a01e1615d4e3242a46fc8e828c929b208e035","unresolved":false,"context_lines":[{"line_number":15,"context_line":"from zuul import model"},{"line_number":16,"context_line":"from zuul.zk import LockException"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def add_resources(target, source):"},{"line_number":20,"context_line":"    for key, value in source.items():"},{"line_number":21,"context_line":"        if key in target:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_5de75a46","line":18,"in_reply_to":"3f79a3b5_f93fa820","updated":"2018-12-06 07:34:50.000000000","message":"TIL about collections.defaultdict :)","commit_id":"d82e10df8545dd4302f77dee4c415bcc57212669"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"46b7167a56600f5214b19310d87b9f9b31d60a77","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            self.sched.zk.storeNode(node)"},{"line_number":208,"context_line":"            if node.resources:"},{"line_number":209,"context_line":"                add_resources(resources, node.resources)"},{"line_number":210,"context_line":"        if build_set:"},{"line_number":211,"context_line":"            # we have a buildset and thus also tenant and project so we"},{"line_number":212,"context_line":"            # can emit project specific resource usage stats"},{"line_number":213,"context_line":"            tenant_name \u003d build_set.item.layout.tenant.name"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_9fbe71fd","line":210,"updated":"2019-02-08 00:15:38.000000000","message":"Do we want to emitStatResources below if node.resources is not set? Perhaps we want to move this block under the above if node.resources check? Or instead we can remove that block and update this check to be:\n\n  if build_set and node.resources:\n\nThen replace use of the resources dict below with node.resources.","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"e0c78c4eec90a20a5dbf632dcecfe8fc9fafb6b2","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            self.sched.zk.storeNode(node)"},{"line_number":208,"context_line":"            if node.resources:"},{"line_number":209,"context_line":"                add_resources(resources, node.resources)"},{"line_number":210,"context_line":"        if build_set:"},{"line_number":211,"context_line":"            # we have a buildset and thus also tenant and project so we"},{"line_number":212,"context_line":"            # can emit project specific resource usage stats"},{"line_number":213,"context_line":"            tenant_name \u003d build_set.item.layout.tenant.name"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_0cac9433","line":210,"in_reply_to":"9fdfeff1_9fbe71fd","updated":"2019-02-08 16:59:00.000000000","message":"Will change that to\n\n if build_set and resources:\n\nAs discussed on irc","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"46b7167a56600f5214b19310d87b9f9b31d60a77","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        # build. Further we calculate resource*duration and increment their"},{"line_number":262,"context_line":"        # tenant or project specific counters. With that we have both the"},{"line_number":263,"context_line":"        # current value and also counters to be able to perform accounting."},{"line_number":264,"context_line":"        if tenant and project:"},{"line_number":265,"context_line":"            project_name \u003d project.canonical_name"},{"line_number":266,"context_line":"            subtract_resources("},{"line_number":267,"context_line":"                self.current_resources_by_tenant[tenant], resources)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_5f36c9b6","line":264,"updated":"2019-02-08 00:15:38.000000000","message":"See above comment doe we need to check if node.resources is set here? and if so maybe we can just use node.resources in place of resources dict below?","commit_id":"f8e912a197b55df3ddbf4fc0ac21fb79c77cc00d"}]}
