summaryrefslogtreecommitdiff
path: root/neutron/notifiers
diff options
context:
space:
mode:
authorBence Romsics <bence.romsics@gmail.com>2019-06-20 12:10:21 +0200
committerBence Romsics <bence.romsics@gmail.com>2019-07-09 13:28:33 +0200
commit45e59e3a1838c1a2069c5cb759060fedb81727c6 (patch)
treed65dc4d6d1e311bbded32f709e8c90749fbffc51 /neutron/notifiers
parentba436615b06a19e1c3e0b00727845928a8067dce (diff)
downloadneutron-45e59e3a1838c1a2069c5cb759060fedb81727c6.tar.gz
Propagate profiler info into BatchNotifier threads
While working on improving the osprofiler report in neutron I'm finding various places where the profiling can be extended by propagating the profiler info further then before. This change starts to profile BatchNotifier threads (e.g. various callbacks to nova) when the code starting the thread was already profiled (it's not at the moment, but that will be another change). In this change we use osprofiler.profiler.clean(). Since that has became part of the public interface of osprofiler in version 2.3.0, we bump osprofiler version to 2.3.0 both in lower-constraints and requirements. Change-Id: Ibd08e097b6f8457c50f8ba9e4a63b96e7e3182bc Partial-Bug: #1833674
Diffstat (limited to 'neutron/notifiers')
-rw-r--r--neutron/notifiers/batch_notifier.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/neutron/notifiers/batch_notifier.py b/neutron/notifiers/batch_notifier.py
index 3e5c6f9666..9c5c77456f 100644
--- a/neutron/notifiers/batch_notifier.py
+++ b/neutron/notifiers/batch_notifier.py
@@ -14,6 +14,8 @@ import eventlet
from neutron_lib.utils import runtime
from oslo_utils import uuidutils
+from neutron.common import utils
+
class BatchNotifier(object):
def __init__(self, batch_interval, callback):
@@ -53,7 +55,7 @@ class BatchNotifier(object):
# events to batch up
eventlet.sleep(self.batch_interval)
- eventlet.spawn_n(synced_send)
+ utils.spawn_n(synced_send)
def _notify(self):
if not self.pending_events: