本文整理汇总了Python中test.get_collector_config函数的典型用法代码示例。如果您正苦于以下问题:Python get_collector_config函数的具体用法?Python get_collector_config怎么用?Python get_collector_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_collector_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config('UptimeCollector', {
'interval': '10',
})
else:
config = get_collector_config('UptimeCollector', config)
self.collector = UptimeCollector(config, None)
示例2: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config('SunOSDiskHealthCollector',
{'interval': '10'})
else:
config = get_collector_config('SunOSDiskHealthCollector',
config)
self.collector = SunOSDiskHealthCollector(config, None)
示例3: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config("WebsiteCollector", {"url": ""})
else:
config = get_collector_config("WebsiteCollector", config)
self.collector = WebsiteMonitorCollector(config, None)
self.patcher = patch("urllib2.urlopen")
self.urlopen_mock = self.patcher.start()
示例4: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config('WebsiteCollector', {
'url': ''
})
else:
config = get_collector_config('WebsiteCollector', config)
self.collector = WebsiteMonitorCollector(config, None)
self.patcher = patch('urllib2.urlopen')
self.urlopen_mock = self.patcher.start()
示例5: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config(
"HttpdCollector", {"interval": "10", "url": "http://www.example.com:80/server-status?auto"}
)
else:
config = get_collector_config("HttpdCollector", config)
self.collector = HttpdCollector(config, None)
self.HTTPResponse = TestHTTPResponse()
httplib.HTTPConnection.request = Mock(return_value=True)
httplib.HTTPConnection.getresponse = Mock(return_value=self.HTTPResponse)
示例6: setUp
def setUp(self):
config = get_collector_config('MongoDBCollector', {
'host': 'localhost:27017',
'databases': '^db'
})
self.collector = MongoDBCollector(config, None)
self.connection = MagicMock()
示例7: setUp
def setUp(self):
config = get_collector_config('MemoryCgroupCollector', {
'interval': 10,
'byte_unit': 'megabyte'
})
self.collector = MemoryCgroupCollector(config, None)
示例8: setUp
def setUp(self):
config = get_collector_config('TwemproxyCollector', {
'interval': 60,
'hosts': ['localhost:22222'],
})
self.collector = TwemproxyCollector(config, None)
示例9: setUp
def setUp(self):
config = get_collector_config('DiskSpaceCollector', {
'interval': 10,
'byte_unit': ['gigabyte'],
})
self.collector = DiskSpaceCollector(config, None)
示例10: setUp
def setUp(self):
config = get_collector_config('UserScriptsCollector', {
'interval': 10,
'scripts_path': os.path.dirname(__file__) + '/fixtures/',
})
self.collector = UserScriptsCollector(config, None)
示例11: setUp
def setUp(self):
config = get_collector_config('NetworkCollector', {
'interval': 10,
'byte_unit': ['megabit', 'megabyte'],
})
self.collector = NetworkCollector(config, None)
示例12: setUp
def setUp(self):
config = get_collector_config('RedisCollector', {
'interval': '1',
'databases': 1,
})
self.collector = RedisCollector(config, None)
示例13: setUp
def setUp(self):
config = get_collector_config('KVMCollector', {
'interval': 10,
})
self.collector = KVMCollector(config, None)
self.collector.PROC = os.path.dirname(__file__) + '/fixtures/'
示例14: setUp
def setUp(self, config=None):
if config is None:
config = get_collector_config('HttpdCollector', {
'interval': '10',
'url': ''
})
else:
config = get_collector_config('HttpdCollector', config)
self.collector = HttpdCollector(config, None)
self.HTTPResponse = TestHTTPResponse()
httplib.HTTPConnection.request = Mock(return_value=True)
httplib.HTTPConnection.getresponse = Mock(
return_value=self.HTTPResponse)
示例15: setUp
def setUp(self):
config = get_collector_config('HttpCollector', {
'req_vhost': 'www.my_server.com',
'req_url': ['http://www.my_server.com/']
})
self.collector = HttpCollector(config, None)