當前位置: 首頁>>代碼示例>>Python>>正文


Python FinalStatus.aggregated_second方法代碼示例

本文整理匯總了Python中bzt.modules.reporting.FinalStatus.aggregated_second方法的典型用法代碼示例。如果您正苦於以下問題:Python FinalStatus.aggregated_second方法的具體用法?Python FinalStatus.aggregated_second怎麽用?Python FinalStatus.aggregated_second使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bzt.modules.reporting.FinalStatus的用法示例。


在下文中一共展示了FinalStatus.aggregated_second方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_log_messages_percentiles

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_percentiles(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({"failed-labels": False, "percentiles": True, "summary": False,
                                               "test-duration": False, "summary-labels": False})
        self.sniff_log(obj.log)

        obj.startup()
        obj.shutdown()
        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()
        target_output = ("Average times: total 0.001, latency 0.000, connect 0.000\n"
                         "Percentiles:\n"
                         "+---------------+---------------+\n"
                         "| Percentile, % | Resp. Time, s |\n"
                         "+---------------+---------------+\n"
                         "|           0.0 |           0.0 |\n"
                         "|          50.0 |           0.0 |\n"
                         "|          90.0 |         0.001 |\n"
                         "|          95.0 |         0.001 |\n"
                         "|          99.0 |         0.003 |\n"
                         "|          99.9 |         0.008 |\n"
                         "|         100.0 |         0.081 |\n"
                         "+---------------+---------------+\n"
                         )
        self.assertEqual(target_output, self.log_recorder.info_buff.getvalue())
開發者ID:andy7i,項目名稱:taurus,代碼行數:28,代碼來源:test_FinalStatusReporter.py

示例2: test_log_messages_samples_count

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_samples_count(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict()
        log_recorder = RecordingHandler()
        obj.log.addHandler(log_recorder)
        obj.parameters.merge({"failed-labels": False, "percentiles": False, "summary": True, "test-duration": False})
        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()

        self.assertEqual("Samples count: 59314, 50.00% failures\n", log_recorder.info_buff.getvalue())
        obj.log.removeHandler(log_recorder)
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatusReporter.py

示例3: test_log_messages_failed_labels

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_failed_labels(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict()
        log_recorder = RecordingHandler()
        obj.log.addHandler(log_recorder)
        obj.parameters.merge({"failed-labels": True, "percentiles": False, "summary": False, "test-duration": False})

        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()
        self.assertIn("29656 failed samples: http://192.168.1.1/anotherquery\n", log_recorder.info_buff.getvalue())
        obj.log.removeHandler(log_recorder)
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatusReporter.py

示例4: test_log_messages_samples_count

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_samples_count(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({"failed-labels": False, "percentiles": False, "summary": True,
                                               "test-duration": False, "summary-labels": False})
        self.sniff_log(obj.log)
        obj.aggregated_second(self.__get_datapoint())
        obj.startup()
        obj.shutdown()
        obj.post_process()

        self.assertEqual("Samples count: 59314, 50.00% failures\n", self.log_recorder.info_buff.getvalue())
開發者ID:andy7i,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatusReporter.py

示例5: test_log_messages_failed_labels

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_failed_labels(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({"failed-labels": True, "percentiles": False, "summary": False,
                                               "test-duration": False})
        self.sniff_log(obj.log)

        obj.startup()
        obj.shutdown()
        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()
        self.assertIn("29656 failed samples: http://192.168.1.1/anotherquery\n", self.log_recorder.info_buff.getvalue())
開發者ID:andy7i,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatusReporter.py

示例6: test_long_kpi

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_long_kpi(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({"dump-xml": obj.engine.create_artifact("status", ".xml")})

        datapoint = random_datapoint(time.time())
        datapoint[datapoint.CUMULATIVE][""]["stdev_rt"] = long(0)
        obj.aggregated_second(datapoint)
        obj.startup()
        obj.shutdown()

        obj.post_process()
開發者ID:andy7i,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatusReporter.py

示例7: test_dump

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_dump(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict()
        log_recorder = RecordingHandler()
        obj.log.addHandler(log_recorder)
        obj.parameters.merge({
            "dump-xml": obj.engine.create_artifact("status", ".xml"),
            "dump-csv": obj.engine.create_artifact("status", ".csv")
        })

        obj.aggregated_second(random_datapoint(time.time()))
        obj.post_process()
        self.assertIn("XML", log_recorder.info_buff.getvalue())
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:16,代碼來源:test_FinalStatusReporter.py

示例8: test_dump

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_dump(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({
            "dump-xml": obj.engine.create_artifact("status", ".xml"),
            "dump-csv": obj.engine.create_artifact("status", ".csv")
        })
        self.sniff_log(obj.log)

        obj.aggregated_second(random_datapoint(time.time()))
        obj.startup()
        obj.shutdown()

        obj.post_process()
        self.assertIn("XML", self.log_recorder.info_buff.getvalue())
開發者ID:andy7i,項目名稱:taurus,代碼行數:17,代碼來源:test_FinalStatusReporter.py

示例9: test_xml_report_test_duration

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_xml_report_test_duration(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        xml_report = obj.engine.create_artifact("status", ".xml")
        obj.parameters = BetterDict.from_dict({
            "dump-xml": xml_report,
        })

        obj.startup()
        obj.aggregated_second(self.__get_datapoint(ts=90))
        obj.aggregated_second(self.__get_datapoint(ts=100))
        obj.shutdown()
        obj.post_process()

        self.assertTrue(os.path.exists(xml_report))
        with open(xml_report) as fds:
            report_content = fds.read()
        self.assertIn('<TestDuration>10.0</TestDuration>', report_content)
開發者ID:andy7i,項目名稱:taurus,代碼行數:20,代碼來源:test_FinalStatusReporter.py

示例10: test_log_messages_percentiles

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_percentiles(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict()
        self.sniff_log(obj.log)
        obj.parameters.merge({"failed-labels": False, "percentiles": True, "summary": False, "test-duration": False})

        obj.startup()
        obj.shutdown()
        obj.aggregated_second(self.__get_datapoint())
        obj.post_process()
        target_output = ("Average times: total 0.001, latency 0.000, connect 0.000\n"
                         "Percentile 0.0%: 0.000\n"
                         "Percentile 50.0%: 0.000\n"
                         "Percentile 90.0%: 0.001\n"
                         "Percentile 95.0%: 0.001\n"
                         "Percentile 99.0%: 0.003\n"
                         "Percentile 99.9%: 0.008\n"
                         "Percentile 100.0%: 0.081\n"
                         )
        self.assertEqual(target_output, self.log_recorder.info_buff.getvalue())
開發者ID:keithmork,項目名稱:taurus,代碼行數:23,代碼來源:test_FinalStatusReporter.py

示例11: test_blazemeter_cloud_report_link

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_blazemeter_cloud_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,
        })

        prov = CloudProvisioning()
        prov.results_url = "http://report/link"
        obj.engine.provisioning = prov

        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

示例12: test_log_messages_summary_labels

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_log_messages_summary_labels(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict.from_dict({"summary-labels": True, "percentiles": False, "summary": False,
                                               "test-duration": False})
        self.sniff_log(obj.log)

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

        expected = ("Request label stats:\n"
                    "+----------------------------------+--------+---------+--------+-----------+\n"
                    "| label                            | status |    succ | avg_rt | error     |\n"
                    "+----------------------------------+--------+---------+--------+-----------+\n"
                    "| http://192.168.1.1/anotherquery  |  FAIL  |   0.00% |  0.001 | Forbidden |\n"
                    "| http://192.168.1.1/somequery     |   OK   | 100.00% |  0.001 |           |\n"
                    "| http://192.168.100.100/somequery |   OK   | 100.00% |  0.001 |           |\n"
                    "+----------------------------------+--------+---------+--------+-----------+\n")

        self.assertIn(expected, self.log_recorder.info_buff.getvalue())
開發者ID:andy7i,項目名稱:taurus,代碼行數:24,代碼來源:test_FinalStatusReporter.py

示例13: test_csv_report_fieldname_order

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_csv_report_fieldname_order(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        csv_report = obj.engine.create_artifact("report", ".csv")
        obj.parameters = BetterDict.from_dict({
            "dump-csv": csv_report,
        })

        obj.startup()
        obj.aggregated_second(self.__get_datapoint(ts=90))
        obj.aggregated_second(self.__get_datapoint(ts=100))
        obj.shutdown()
        obj.post_process()

        self.assertTrue(os.path.exists(csv_report))
        with open(csv_report) as fds:
            fieldnames = fds.readline().strip().split(",")

        perc_fields = [float(name[5:]) for name in fieldnames if name.startswith('perc_')]
        self.assertTrue(sorted(perc_fields) == perc_fields)

        rc_fields = [float(name[3:]) for name in fieldnames if name.startswith('rc_')]
        self.assertTrue(sorted(rc_fields) == rc_fields)
開發者ID:andy7i,項目名稱:taurus,代碼行數:25,代碼來源:test_FinalStatusReporter.py

示例14: test_blazemeter_report_link

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
    def test_blazemeter_report_link(self):
        obj = FinalStatus()
        obj.engine = EngineEmul()
        obj.parameters = BetterDict()
        xml_report = obj.engine.create_artifact("status", ".xml")
        obj.parameters.merge({
            "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:keithmork,項目名稱:taurus,代碼行數:25,代碼來源:test_FinalStatusReporter.py

示例15: test_xml_report_test_duration_failed_prepare

# 需要導入模塊: from bzt.modules.reporting import FinalStatus [as 別名]
# 或者: from bzt.modules.reporting.FinalStatus import aggregated_second [as 別名]
 def test_xml_report_test_duration_failed_prepare(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict()
     obj.aggregated_second(self.__get_datapoint(ts=100))
     obj.post_process()  # shouldn't raise ValueError because obj.start_time is None
開發者ID:andy7i,項目名稱:taurus,代碼行數:8,代碼來源:test_FinalStatusReporter.py


注:本文中的bzt.modules.reporting.FinalStatus.aggregated_second方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。