本文整理汇总了Python中ddagent.Application.run方法的典型用法代码示例。如果您正苦于以下问题:Python Application.run方法的具体用法?Python Application.run怎么用?Python Application.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ddagent.Application
的用法示例。
在下文中一共展示了Application.run方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DDForwarder
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
class DDForwarder(multiprocessing.Process):
def __init__(self, agentConfig, hostname):
multiprocessing.Process.__init__(self, name='ddforwarder')
self.config = agentConfig
self.is_enabled = True
self.hostname = hostname
def run(self):
from config import initialize_logging
initialize_logging('windows_forwarder')
log.debug("Windows Service - Starting forwarder")
set_win32_cert_path()
port = self.config.get('listen_port', 17123)
if port is None:
port = 17123
else:
port = int(port)
app_config = get_config(parse_args=False)
self.forwarder = Application(port, app_config, watchdog=False)
try:
self.forwarder.run()
except Exception:
log.exception("Uncaught exception in the forwarder")
def stop(self):
log.debug("Windows Service - Stopping forwarder")
self.forwarder.stop()
示例2: use_lots_of_memory
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
def use_lots_of_memory(self):
# Skip this step on travis
if os.environ.get('TRAVIS', False): return
a = Application(12345, {"bind_host": "localhost"})
a._watchdog = Watchdog(30, 50)
a._tr_manager = MemoryHogTxManager()
a.run()
示例3: DDForwarder
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
class DDForwarder(threading.Thread):
def __init__(self, agentConfig):
threading.Thread.__init__(self)
set_win32_cert_path()
self.config = get_config(parse_args = False)
port = agentConfig.get('listen_port', 17123)
if port is None:
port = 17123
else:
port = int(port)
self.port = port
self.forwarder = Application(port, agentConfig, watchdog=False)
def run(self):
self.forwarder.run()
def stop(self):
self.forwarder.stop()
示例4: DDForwarder
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
class DDForwarder(multiprocessing.Process):
def __init__(self, agentConfig):
multiprocessing.Process.__init__(self, name='ddforwarder')
self.config = agentConfig
def run(self):
log.debug("Windows Service - Starting forwarder")
set_win32_cert_path()
port = self.config.get('listen_port', 17123)
if port is None:
port = 17123
else:
port = int(port)
app_config = get_config(parse_args = False)
self.forwarder = Application(port, app_config, watchdog=False)
self.forwarder.run()
def stop(self):
log.debug("Windows Service - Stopping forwarder")
self.forwarder.stop()
示例5: fast_tornado
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
def fast_tornado(self):
a = Application(12345, {"bind_host": "localhost"})
a._watchdog = Watchdog(6)
a._tr_manager = MockTxManager()
a.run()
示例6: use_lots_of_memory
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
def use_lots_of_memory(self):
a = Application(12345, {})
a._watchdog = Watchdog(30, 50)
a._tr_manager = MemoryHogTxManager()
a.run()
示例7: fast_tornado
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
def fast_tornado(self):
a = Application(12345, {})
a._watchdog = Watchdog(6)
a._tr_manager = MockTxManager()
a.run()
示例8: slow_tornado
# 需要导入模块: from ddagent import Application [as 别名]
# 或者: from ddagent.Application import run [as 别名]
def slow_tornado(self):
a = Application(12345, self.AGENT_CONFIG)
a._watchdog = Watchdog(4)
a._tr_manager = MockTxManager()
a.run()