本文整理汇总了Python中jsonrpclib.Server.kill方法的典型用法代码示例。如果您正苦于以下问题:Python Server.kill方法的具体用法?Python Server.kill怎么用?Python Server.kill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonrpclib.Server
的用法示例。
在下文中一共展示了Server.kill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import kill [as 别名]
def execute(self, cleanup=True):
"""
Execute the bugger
:return:
"""
res = None
try:
res = self._server.execute(self._pdict, cleanup)
except KeyboardInterrupt:
self.monitor.stop()
server2 = Server(self.url)
server2.kill()
except socket.error:
self.log.error("Server was interrupted")
exit(1)
finally:
self.monitor.stop()
if res is None:
raise ValueError("Run failed")
resstr = "%s\t%s\t %s\t %s\t %s\t %s\t %s" % (str(datetime.datetime.utcnow()), self.message,
self._pdict["cpuRangeVal"], self._pdict["outputDir"],
res["Wallclock"], res["peak"]/1024.**3, res["avg"]/1024**3)
self.log.info("date \t\t\t message \t\t cpu \t outputdir \t time \t peak_mem \t avg_mem")
self.log.info(resstr)
with open(os.path.expanduser("~/result.dat"), "a") as out:
out.write(resstr+"\n")