本文整理匯總了Python中bzt.modules.blazemeter.BlazeMeterUploader.settings['send-custom-metrics']方法的典型用法代碼示例。如果您正苦於以下問題:Python BlazeMeterUploader.settings['send-custom-metrics']方法的具體用法?Python BlazeMeterUploader.settings['send-custom-metrics']怎麽用?Python BlazeMeterUploader.settings['send-custom-metrics']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bzt.modules.blazemeter.BlazeMeterUploader
的用法示例。
在下文中一共展示了BlazeMeterUploader.settings['send-custom-metrics']方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_check
# 需要導入模塊: from bzt.modules.blazemeter import BlazeMeterUploader [as 別名]
# 或者: from bzt.modules.blazemeter.BlazeMeterUploader import settings['send-custom-metrics'] [as 別名]
def test_check(self):
client = BlazeMeterClientEmul(logging.getLogger(''))
client.timeout = 1
client.results.append({"marker": "ping", 'result': {}})
client.results.append({"marker": "projects", 'result': []})
client.results.append({"marker": "project-create", 'result': {
"id": time.time(),
"name": "boo",
"userId": time.time(),
"description": None,
"created": time.time(),
"updated": time.time(),
"organizationId": None
}})
client.results.append({"marker": "tests", 'result': {}})
client.results.append({"marker": "test-create", 'result': {'id': 'unittest1'}})
client.results.append(
{"marker": "sess-start",
"result": {
'session': {'id': 'sess1', 'userId': 1},
'master': {'id': 'master1', 'userId': 1},
'signature': ''}})
client.results.append({"marker": "first push", 'result': {'session': {}}})
client.results.append(IOError("monitoring push expected fail"))
client.results.append({"marker": "mon push", "result": True})
client.results.append(IOError("custom metric push expected fail"))
client.results.append({"marker": "custom metrics push", "result": True})
client.results.append({"marker": "second push", 'result': {'session': {"statusCode": 140, 'status': 'ENDED'}}})
client.results.append({"marker": "post-proc push", 'result': {'session': {}}})
client.results.append({"marker": "post process monitoring push", "result": True})
client.results.append({"marker": "post process custom metrics push", "result": True})
client.results.append({"marker": "artifacts push", 'result': True})
client.results.append({"marker": "logs push", 'result': True})
client.results.append({"marker": "terminate", 'result': {'session': {}}})
obj = BlazeMeterUploader()
obj.parameters['project'] = 'Proj name'
obj.settings['token'] = '123'
obj.settings['browser-open'] = 'none'
obj.settings['send-custom-metrics'] = True
obj.settings['send-custom-tables'] = True
obj.engine = EngineEmul()
shutil.copy(__file__, obj.engine.artifacts_dir + os.path.basename(__file__))
obj.client = client
obj.prepare()
obj.startup()
for x in range(0, 31):
obj.aggregated_second(random_datapoint(x))
mon = [{"ts": 1, "source": "local", "cpu": 1, "mem": 2, "bytes-recv": 100, "other": 0},
{"ts": 1, "source": "chrome", "memory": 32, "cpu": 23}]
obj.monitoring_data(mon)
obj.check()
for x in range(32, 65):
obj.aggregated_second(random_datapoint(x))
self.assertRaises(KeyboardInterrupt, obj.check)
obj.aggregated_second(random_datapoint(10))
obj.shutdown()
log_file = obj.engine.create_artifact('log', '.tmp')
obj.engine.log.parent.handlers.append(logging.FileHandler(log_file))
obj.engine.config.get('modules').get('shellexec').get('env')['TAURUS_INDEX_ALL'] = 1
obj.post_process()
self.assertEqual(0, len(client.results))