)]}'
{"oslo_messaging/metrics/client.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8e43cdbf1cb1871e6fdbc428cae47e8ebf781085","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import socket"},{"line_number":17,"context_line":"import threading"},{"line_number":18,"context_line":"import queue"},{"line_number":19,"context_line":"import time"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_5629e5e3","line":18,"updated":"2020-11-09 03:17:20.000000000","message":"pep8: H306: imports not in alphabetical order (threading, queue)","commit_id":"92d9fad1a2e38e7f03ba8911c8af4b3d389e0b0c"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8e43cdbf1cb1871e6fdbc428cae47e8ebf781085","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        )"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def rpc_client_processing_time(self, target, method, call_type,"},{"line_number":144,"context_line":"                                      duration, timeout\u003dNone):"},{"line_number":145,"context_line":"        self.put_rpc_client_metrics_to_txqueue("},{"line_number":146,"context_line":"            \"rpc_client_processing_time\","},{"line_number":147,"context_line":"            message_type.MetricAction(\"observe\", duration),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_3626e916","line":144,"updated":"2020-11-09 03:17:20.000000000","message":"pep8: E127 continuation line over-indented for visual indent","commit_id":"92d9fad1a2e38e7f03ba8911c8af4b3d389e0b0c"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8e43cdbf1cb1871e6fdbc428cae47e8ebf781085","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        )"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def rpc_server_processing_time(self, target, endpoint, ns, ver,"},{"line_number":197,"context_line":"                                      method, duration):"},{"line_number":198,"context_line":"        self.put_rpc_server_metrics_to_txqueue("},{"line_number":199,"context_line":"            \"rpc_server_processing_time\","},{"line_number":200,"context_line":"            message_type.MetricAction(\"observe\", duration),"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_961ffdb5","line":197,"updated":"2020-11-09 03:17:20.000000000","message":"pep8: E127 continuation line over-indented for visual indent","commit_id":"92d9fad1a2e38e7f03ba8911c8af4b3d389e0b0c"},{"author":{"_account_id":8770,"name":"Ken Giusti","email":"kgiusti@gmail.com","username":"kgiusti"},"change_message_id":"3ab50194d2fcb3be3e81a645b4fa36cfd27242ab","unresolved":true,"context_lines":[{"line_number":37,"context_line":"                    \u0027to send rpc related metrics\u0027),"},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027metrics_process_name\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027Process name which is used to idenfity which process\u0027"},{"line_number":41,"context_line":"                    \u0027produce metrics\u0027),"},{"line_number":42,"context_line":"    cfg.IntOpt(\u0027metrics_thread_stop_timeout\u0027,"},{"line_number":43,"context_line":"               default\u003d10,"}],"source_content_type":"text/x-python","patch_set":6,"id":"28f9a9c1_7ba4c992","line":40,"updated":"2021-01-18 14:40:47.000000000","message":"spelling: \"identify\"","commit_id":"3c89ff987aaa50293984e9710b97e9493f88ceba"},{"author":{"_account_id":32523,"name":"Ching Kuo","display_name":"Gene Kuo","email":"igene@igene.tw","username":"genekuo"},"change_message_id":"2adcb9a3596d6bbf1fc159beda1a0cd76c1c4ba5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                    \u0027to send rpc related metrics\u0027),"},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027metrics_process_name\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027Process name which is used to idenfity which process\u0027"},{"line_number":41,"context_line":"                    \u0027produce metrics\u0027),"},{"line_number":42,"context_line":"    cfg.IntOpt(\u0027metrics_thread_stop_timeout\u0027,"},{"line_number":43,"context_line":"               default\u003d10,"}],"source_content_type":"text/x-python","patch_set":6,"id":"dbdc795e_41bd3063","line":40,"in_reply_to":"28f9a9c1_7ba4c992","updated":"2021-02-23 11:49:27.000000000","message":"Done","commit_id":"3c89ff987aaa50293984e9710b97e9493f88ceba"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"58e4a8f15c7fea515f78a844cb30a7837990452c","unresolved":true,"context_lines":[{"line_number":59,"context_line":"        buffer_size \u003d self.conf.oslo_messaging_metrics.metrics_buffer_size"},{"line_number":60,"context_line":"        self.tx_queue \u003d queue.Queue(buffer_size)"},{"line_number":61,"context_line":"        self.next_send_metric \u003d None"},{"line_number":62,"context_line":"        self.send_thread \u003d threading.Thread(target\u003dself.send_loop)"},{"line_number":63,"context_line":"        self.send_thread.start()"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def put_into_txqueue(self, metrics_name, action, **labels):"}],"source_content_type":"text/x-python","patch_set":10,"id":"0c9a648b_6adff13b","line":62,"range":{"start_line":62,"start_character":27,"end_line":62,"end_character":66},"updated":"2021-05-06 09:35:20.000000000","message":"Hello,\n\nI think that we need to be cautious here (with threading).\n\nWhen there\u0027s no active request, the worker process gets parked, so, it doesn\u0027t run the thread and we should start observing related issues with the metric collector.\n\nWhen we don\u0027t use a native python thread then process become idle due to green thread/eventlet.\nmod_wsgi and green thread aren\u0027t really compatible, it\u0027s just due to the way mod_wsgi handles processes.\n\nFew years ago we experienced similar issues [1] with the rabbitmq heartbeat, and I think that here we are more or less in a similar context.\n\nThat can be easily fixed by using a python thread by default and all the time (e.g [2][3]).\n\nI think that we need to follow the same path here and applying a native python thread to all the threads used here.\n\n[1] https://opendev.org/openstack/oslo.messaging/commit/22f240b82fffbd62be8568a7d0d3369134596ace\n[2] https://opendev.org/openstack/oslo.messaging/src/branch/master/oslo_messaging/_drivers/impl_rabbit.py#L49-L59\n[3] https://opendev.org/openstack/oslo.messaging/src/branch/master/oslo_messaging/_drivers/impl_rabbit.py#L992","commit_id":"4bf62ed397b1a566864b64727ed9abdd442c0fb1"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"ac9c288986aac9b09fd91ef5041205f4c38841fa","unresolved":true,"context_lines":[{"line_number":67,"context_line":"class MetricsCollectorClient(object):"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, conf, metrics_type, **kwargs):"},{"line_number":70,"context_line":"        self.conf \u003d conf"},{"line_number":71,"context_line":"        self.unix_socket \u003d self.conf.oslo_messaging_metrics.metrics_socket_file"},{"line_number":72,"context_line":"        buffer_size \u003d self.conf.oslo_messaging_metrics.metrics_buffer_size"},{"line_number":73,"context_line":"        self.tx_queue \u003d queue.Queue(buffer_size)"}],"source_content_type":"text/x-python","patch_set":14,"id":"b95f2aaa_6e8cc52a","line":70,"range":{"start_line":70,"start_character":20,"end_line":70,"end_character":24},"updated":"2021-05-12 15:13:30.000000000","message":"Could be `conf.oslo_messaging_metrics` to refer directly on the local config and avoid inline references as below. However, the current version LGTM.\n\nThat could be addressed with a follow up.","commit_id":"0639c60a4adfde25ede0d86fa512ef832102e6bc"},{"author":{"_account_id":32523,"name":"Ching Kuo","display_name":"Gene Kuo","email":"igene@igene.tw","username":"genekuo"},"change_message_id":"9dbd67980214b589587c1124fc7cf80493aaf890","unresolved":true,"context_lines":[{"line_number":67,"context_line":"class MetricsCollectorClient(object):"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, conf, metrics_type, **kwargs):"},{"line_number":70,"context_line":"        self.conf \u003d conf"},{"line_number":71,"context_line":"        self.unix_socket \u003d self.conf.oslo_messaging_metrics.metrics_socket_file"},{"line_number":72,"context_line":"        buffer_size \u003d self.conf.oslo_messaging_metrics.metrics_buffer_size"},{"line_number":73,"context_line":"        self.tx_queue \u003d queue.Queue(buffer_size)"}],"source_content_type":"text/x-python","patch_set":14,"id":"10142d57_aca2c2d3","line":70,"range":{"start_line":70,"start_character":20,"end_line":70,"end_character":24},"in_reply_to":"b95f2aaa_6e8cc52a","updated":"2021-05-13 14:56:01.000000000","message":"Thanks! I updated this part, not sure if I understand your comment correctly. Can you check the newest patch?","commit_id":"0639c60a4adfde25ede0d86fa512ef832102e6bc"},{"author":{"_account_id":8770,"name":"Ken Giusti","email":"kgiusti@gmail.com","username":"kgiusti"},"change_message_id":"867525071cdb51dbe3e1d1f60280cda826de5495","unresolved":true,"context_lines":[{"line_number":50,"context_line":"                    \u0027to send rpc related metrics\u0027),"},{"line_number":51,"context_line":"    cfg.StrOpt(\u0027metrics_process_name\u0027,"},{"line_number":52,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":53,"context_line":"               help\u003d\u0027Process name which is used to identify which process\u0027"},{"line_number":54,"context_line":"                    \u0027produce metrics\u0027),"},{"line_number":55,"context_line":"    cfg.IntOpt(\u0027metrics_thread_stop_timeout\u0027,"},{"line_number":56,"context_line":"               default\u003d10,"}],"source_content_type":"text/x-python","patch_set":15,"id":"e76168a4_ffc4028a","line":53,"updated":"2021-06-07 17:03:14.000000000","message":"multi-line help text like this needs a space at the end or beginning of the lines so the last and first words don\u0027t get squished together.  Minor nit you can follow up with a separate patch if you\u0027d like.","commit_id":"23909b76f66301e094b20853ddb8d160c56fab5f"}],"oslo_messaging/rpc/client.py":[{"author":{"_account_id":8770,"name":"Ken Giusti","email":"kgiusti@gmail.com","username":"kgiusti"},"change_message_id":"e3809a5f0367aa464c2dba0e157e042b706ee9c8","unresolved":true,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        self._check_version_cap(msg.get(\u0027version\u0027))"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        self._metrics_api.rpc_client_invocation_start_total("},{"line_number":153,"context_line":"            self.target, method, \"cast\")"},{"line_number":154,"context_line":"        start_time \u003d time.time()"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da5d0a0e_fd4fb684","line":152,"updated":"2021-03-15 15:36:22.000000000","message":"This start()/end() pattern would be better implemented using a content manager: https://docs.python.org/3/reference/compound_stmts.html#the-with-statement\n\nUsing a context manager should allow you to move all this logic into the the context itself - including the time() tracking - rather than duplicating the code here and in the call() function.\n\n(That\u0027s my assumption, totally untested).","commit_id":"4bf62ed397b1a566864b64727ed9abdd442c0fb1"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"58e4a8f15c7fea515f78a844cb30a7837990452c","unresolved":true,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        self._check_version_cap(msg.get(\u0027version\u0027))"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        self._metrics_api.rpc_client_invocation_start_total("},{"line_number":153,"context_line":"            self.target, method, \"cast\")"},{"line_number":154,"context_line":"        start_time \u003d time.time()"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"e6db507e_5e13adae","line":152,"in_reply_to":"da5d0a0e_fd4fb684","updated":"2021-05-06 09:35:20.000000000","message":"I agree with Ken that will be more appropriate.","commit_id":"4bf62ed397b1a566864b64727ed9abdd442c0fb1"}],"releasenotes/notes/oslo-metrics-support-fe16343a637cc14b.yaml":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"3c3021a07571b91b1e25a96908d5645c9bb00be1","unresolved":true,"context_lines":[{"line_number":4,"context_line":"    | Introduce support for sending rpc client metrics to oslo.metrics."},{"line_number":5,"context_line":"    | This feature can be enabled by setting a configuration parameter:"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"    [oslo_messaging_metrcs]"},{"line_number":8,"context_line":"    metrics_enabled \u003d True  # default is false"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"3fef8931_4b17c1bd","line":7,"range":{"start_line":7,"start_character":20,"end_line":7,"end_character":26},"updated":"2021-06-07 15:45:58.000000000","message":"*metrics","commit_id":"23909b76f66301e094b20853ddb8d160c56fab5f"}]}
