本文整理汇总了Python中xmlrpclib.ServerProxy.getMonitorData方法的典型用法代码示例。如果您正苦于以下问题:Python ServerProxy.getMonitorData方法的具体用法?Python ServerProxy.getMonitorData怎么用?Python ServerProxy.getMonitorData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpclib.ServerProxy
的用法示例。
在下文中一共展示了ServerProxy.getMonitorData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import getMonitorData [as 别名]
#.........这里部分代码省略.........
try:
msg = pickle.loads(self._agent.onPublisherCall(pickle.dumps(msg)))
except:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during OnPublisherCall call." % self._name)
def OnTestFinished(self):
'''
Called right after a test.
'''
msg = _Msg(self._id, _MsgType.OnTestFinished)
try:
msg = pickle.loads(self._agent.onTestFinished(pickle.dumps(msg)))
except:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during OnTestFinished call." % self._name)
def GetMonitorData(self):
'''
Get any monitored data.
'''
msg = _Msg(self._id, _MsgType.GetMonitorData)
try:
msg = pickle.loads(self._agent.getMonitorData(pickle.dumps(msg)))
except:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during GetMonitorData call." % self._name)
return msg.results
def DetectedFault(self):
'''
Check if a fault was detected.
'''
try:
msg = _Msg(self._id, _MsgType.DetectFault)
msg = pickle.loads(self._agent.detectFault(pickle.dumps(msg)))
except:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during GetMonitorData call." % self._name)
return msg.results
def OnFault(self):
'''
Called when a fault was detected.
'''
try:
示例2: AgentClient
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import getMonitorData [as 别名]
#.........这里部分代码省略.........
def OnPublisherCall(self, method):
Debug("> OnPublisherCall")
msg = _Msg(self._id, _MsgType.PublisherCall)
msg.method = method
try:
msg = pickle.loads(self._agent.onPublisherCall(pickle.dumps(msg)))
except Exception as e:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during OnPublisherCall call." % self._name)
Debug("< OnPublisherCall")
return msg.results
def OnTestFinished(self):
"""Called right after a test."""
Debug("> OnTestFinished")
msg = _Msg(self._id, _MsgType.OnTestFinished)
try:
msg = pickle.loads(self._agent.onTestFinished(pickle.dumps(msg)))
except Exception as e:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during OnTestFinished call." % self._name)
Debug("< OnTestFinished")
def GetMonitorData(self):
"""Get any monitored data."""
Debug("> GetMonitorData")
msg = _Msg(self._id, _MsgType.GetMonitorData)
try:
msg = pickle.loads(self._agent.getMonitorData(pickle.dumps(msg)))
except Exception as e:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during GetMonitorData call." % self._name)
Debug("< GetMonitorData")
return msg.results
def RedoTest(self):
"""Should we repeat current test."""
Debug("> RedoTest")
try:
msg = _Msg(self._id, _MsgType.RedoTest)
msg = pickle.loads(self._agent.redoTest(pickle.dumps(msg)))
except Exception as e:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)
if msg.type != _MsgType.Ack:
raise PeachException("Lost connection to Agent %s during RedoTest call." % self._name)
Debug("< RedoTest")
return msg.results
def DetectedFault(self):
"""Check if a fault was detected."""
Debug("> DetectedFault")
try:
msg = _Msg(self._id, _MsgType.DetectFault)
msg = pickle.loads(self._agent.detectFault(pickle.dumps(msg)))
except Exception as e:
self.Reconnect()
raise RedoTestException("Communication error with Agent %s" % self._name)