当前位置: 首页>>代码示例>>Python>>正文


Python BlazeMeterUploader.results_url方法代码示例

本文整理汇总了Python中bzt.modules.blazemeter.BlazeMeterUploader.results_url方法的典型用法代码示例。如果您正苦于以下问题:Python BlazeMeterUploader.results_url方法的具体用法?Python BlazeMeterUploader.results_url怎么用?Python BlazeMeterUploader.results_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bzt.modules.blazemeter.BlazeMeterUploader的用法示例。


在下文中一共展示了BlazeMeterUploader.results_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_blazemeter_report_link

# 需要导入模块: from bzt.modules.blazemeter import BlazeMeterUploader [as 别名]
# 或者: from bzt.modules.blazemeter.BlazeMeterUploader import results_url [as 别名]
    def test_blazemeter_report_link(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        xml_report = obj.engine.create_artifact("status", ".xml")
        obj.parameters = BetterDict.from_dict({
            "dump-xml": xml_report,
        })

        rep = BlazeMeterUploader()
        rep.results_url = "http://report/link"
        obj.engine.reporters.append(rep)

        obj.startup()
        obj.shutdown()

        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()

        self.assertTrue(os.path.exists(xml_report))
        with open(xml_report) as fds:
            report_content = fds.read()
        self.assertIn('<ReportURL>http://report/link</ReportURL>', report_content)
开发者ID:andy7i,项目名称:taurus,代码行数:24,代码来源:test_FinalStatusReporter.py

示例2: test_xml_format_sample_labels

# 需要导入模块: from bzt.modules.blazemeter import BlazeMeterUploader [as 别名]
# 或者: from bzt.modules.blazemeter.BlazeMeterUploader import results_url [as 别名]
    def test_xml_format_sample_labels(self):
        # generate xml, compare hash

        obj = JUnitXMLReporter()
        obj.engine = EngineEmul()
        rep = BlazeMeterUploader()
        rep.results_url = "http://report/123"
        obj.engine.reporters.append(rep)

        path_from_config = tempfile.mktemp(suffix='.xml', prefix='junit-xml-sample-labels',
                                           dir=obj.engine.artifacts_dir)

        # data-source: finalstats by default
        obj.parameters = BetterDict.from_dict({"filename": path_from_config})

        obj.prepare()

        datapoint = DataPoint(0, [])
        cumul_data = datapoint[DataPoint.CUMULATIVE]

        cumul_data[""] = KPISet.from_dict({
            KPISet.AVG_CONN_TIME: 7.890211417203362e-06,
            KPISet.RESP_TIMES: Counter({
                0.0: 32160, 0.001: 24919, 0.002: 1049, 0.003: 630, 0.004: 224, 0.005: 125,
                0.006: 73, 0.007: 46, 0.008: 32, 0.009: 20, 0.011: 8, 0.01: 8, 0.017: 3,
                0.016: 3, 0.014: 3, 0.013: 3, 0.04: 2, 0.012: 2, 0.079: 1, 0.081: 1,
                0.019: 1, 0.015: 1}),
            KPISet.ERRORS: [{'msg': 'Forbidden', 'cnt': 7300, 'type': 0,
                             'urls': Counter({'http://192.168.1.1/anotherquery': 7300}),
                             KPISet.RESP_CODES: '403'},
                            {'msg': 'Assertion failed: text /smth/ not found', 'cnt': 73, 'type': 1,
                             'urls': Counter({'http://192.168.1.1/anotherquery': 73}),
                             KPISet.RESP_CODES: '200'},
                            ],
            KPISet.STDEV_RESP_TIME: 0.04947974228872108,
            KPISet.AVG_LATENCY: 0.0002825639815220692,
            KPISet.RESP_CODES: Counter({'304': 29656, '403': 29656, '200': 2}),
            KPISet.PERCENTILES: {'95.0': 0.001, '0.0': 0.0, '99.9': 0.008, '90.0': 0.001,
                                 '100.0': 0.081, '99.0': 0.003, '50.0': 0.0},
            KPISet.SUCCESSES: 29658,
            KPISet.SAMPLE_COUNT: 59314,
            KPISet.CONCURRENCY: 0,
            KPISet.AVG_RESP_TIME: 0.0005440536804127192,
            KPISet.FAILURES: 29656})

        cumul_data["http://192.168.1.1/somequery"] = KPISet.from_dict({
            KPISet.AVG_CONN_TIME: 9.609548856969457e-06,
            KPISet.RESP_TIMES: Counter({
                0.0: 17219, 0.001: 11246, 0.002: 543, 0.003: 341,
                0.004: 121,
                0.005: 66, 0.006: 36, 0.007: 33, 0.008: 18,
                0.009: 12, 0.011: 6,
                0.01: 5, 0.013: 2, 0.017: 2, 0.012: 2, 0.079: 1,
                0.016: 1,
                0.014: 1, 0.019: 1, 0.04: 1, 0.081: 1}),
            KPISet.ERRORS: [],
            KPISet.STDEV_RESP_TIME: 0.04073402130687656,
            KPISet.AVG_LATENCY: 1.7196034796682178e-06,
            KPISet.RESP_CODES: Counter({'304': 29656, '200': 2}),
            KPISet.PERCENTILES: {'95.0': 0.001, '0.0': 0.0,
                                 '99.9': 0.009,
                                 '90.0': 0.001,
                                 '100.0': 0.081,
                                 '99.0': 0.004,
                                 '50.0': 0.0},
            KPISet.SUCCESSES: 29658,
            KPISet.SAMPLE_COUNT: 29658,
            KPISet.CONCURRENCY: 0,
            KPISet.AVG_RESP_TIME: 0.0005164542450603551, KPISet.FAILURES: 0})

        cumul_data["http://192.168.1.1/anotherquery"] = KPISet.from_dict({
            KPISet.AVG_CONN_TIME: 6.1707580253574335e-06,
            KPISet.RESP_TIMES: Counter({0.0: 14941, 0.001: 13673, 0.002: 506,
                                        0.003: 289, 0.004: 103,
                                        0.005: 59, 0.006: 37, 0.008: 14,
                                        0.007: 13, 0.009: 8, 0.01: 3,
                                        0.011: 2, 0.016: 2, 0.014: 2,
                                        0.017: 1, 0.013: 1, 0.015: 1,
                                        0.04: 1}),
            KPISet.ERRORS: [
                {'msg': 'Forbidden', 'cnt': 7300, 'type': 0,
                 'urls': Counter({'http://192.168.1.1/anotherquery': 7300}),
                 KPISet.RESP_CODES: '403'},
                {'msg': 'Assertion failed: text /smth/ not found', 'cnt': 73, 'type': 1,
                 'urls': Counter({'http://192.168.1.1/anotherquery': 73}),
                 KPISet.RESP_CODES: '200'},
            ],
            KPISet.STDEV_RESP_TIME: 0.032465137860758844,
            KPISet.AVG_LATENCY: 0.0005634272997032645,
            KPISet.RESP_CODES: Counter({'403': 29656}),
            KPISet.PERCENTILES: {'95.0': 0.001, '0.0': 0.0,
                                 '99.9': 0.008, '90.0': 0.001,
                                 '100.0': 0.04, '99.0': 0.003,
                                 '50.0': 0.0},
            KPISet.SUCCESSES: 0,
            KPISet.SAMPLE_COUNT: 29656,
            KPISet.CONCURRENCY: 0,
            KPISet.AVG_RESP_TIME: 0.0005716549770704078,
            KPISet.FAILURES: 29656})

#.........这里部分代码省略.........
开发者ID:andy7i,项目名称:taurus,代码行数:103,代码来源:test_JUnitXMLReporter.py


注:本文中的bzt.modules.blazemeter.BlazeMeterUploader.results_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。