码迷,mamicode.com
首页 > 其他好文 > 详细

aodh M版本新特性 - queue between alarm evaluator and alarm notifier

时间:2016-04-18 15:02:07      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:

之前alarm evaluator service and alarm notifier services之间的通信采用RPC的方式,消耗较大,增加work queue的方式可以获得更好的性能,

+        if conf.ipc_protocol == rpc:
+            self.ipc = rpc
+            self.rpc_server = messaging.get_rpc_server(
+                conf, transport, conf.notifier_rpc_topic, self)
+        else:
+            self.ipc = queue
+            target = oslo_messaging.Target(topic=conf.notifier_topic)
+            self.listener = messaging.get_notification_listener(
+                transport, [target],
+                [AlarmEndpoint(self.notifiers)])

所谓work queue的方式就是把evaluator 的结果作为消息的payload发送给alarm:

+        payload = {actions: actions,
+                   alarm_id: alarm.alarm_id,
+                   alarm_name: alarm.name,
+                   severity: alarm.severity,
+                   previous: previous,
+                   current: alarm.state,
+                   reason: six.text_type(reason),
+                   reason_data: reason_data}
+        self.notifier.sample(self.ctxt, alarm.update, payload)

参考:https://review.openstack.org/#/c/247211/

aodh M版本新特性 - queue between alarm evaluator and alarm notifier

标签:

原文地址:http://www.cnblogs.com/allcloud/p/5404214.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!