0

我正在使用 Taurus & Jmeter 编写一些性能测试。在对某些 URL 执行一组测试后,我在控制台上看到了如下统计信息。

19:03:40 INFO: Percentiles:
+---------------+---------------+
| Percentile, % | Resp. Time, s |
+---------------+---------------+
|          95.0 |         2.731 |
+---------------+---------------+
19:03:40 INFO: Request label stats:
+--------------+--------+---------+--------+-------+
| label        | status |    succ | avg_rt | error |
+--------------+--------+---------+--------+-------+
| /v1/brands   |   OK   | 100.00% |  2.730 |       |
| /v1/catalogs |   OK   | 100.00% |  1.522 |       |
+--------------+--------+---------+--------+-------+

我想知道是否有办法显示每个 URL 的其他标签。例如。每个 URL 的百分位响应时间。

以下是可以从 Taurus 捕获的所有统计数据。(根据 taurus 文档),但我无法弄清楚将它们显示到控制台所需的配置。感谢任何帮助。

label - is the sample group for which this CSV line presents the stats. Empty label means total of all labels
concurrency - average number of Virtual Users
throughput - total count of all samples
succ - total count of not-failed samples
fail - total count of saved samples
avg_rt - average response time
stdev_rt - standard deviation of response time
avg_ct - average connect time if present
avg_lt - average latency if present
rc_200 - counts for specific response codes
perc_0.0 .. perc_100.0 - percentile levels for response time, 0 is also minimum response time, 100 is maximum
bytes - total download size
4

1 回答 1

0

查看Taurus Console Reporter上的文档,只能修改以下参数:

modules:
  console:
    # disable console reporter
    disable: false  # default: auto
 
    # configure screen type
    screen: console
    # valid values are:
    # - console (ncurses-based dashboard, default for *nix systems)
    # - gui (window-based dashboard, default for Windows, requires Tkinter)
    # - dummy (text output into console for non-tty cases)

    dummy-cols: 140  # width for dummy screen
    dummy-rows: 35   # height for dummy screen

如果您能理解和编写 Python 代码,您可以尝试修改reporting.py负责生成统计信息和汇总表的文件。这是一个很好的起点:

def __report_summary_labels(self, cumulative):
    data = [("label", "status", "succ", "avg_rt", "error")]
    justify = {0: "left", 1: "center", 2: "right", 3: "right", 4: "left"}

    sorted_labels = sorted(cumulative.keys())
    for sample_label in sorted_labels:
        if sample_label != "":
            data.append(self.__get_sample_element(cumulative[sample_label], sample_label))
    table = SingleTable(data) if sys.stdout.isatty() else AsciiTable(data)
    table.justify_columns = justify
    self.log.info("Request label stats:\n%s", table.table)

否则,您也可以使用在线交互式报告配置您的 JMeter 测试以使用 Grafana 和 InfluxDB作为 3rd 方指标存储和可视化系统。

于 2018-10-08T04:53:40.327 回答