如何在控制台上显示每个URL的百分位数统计信息

时间:2018-10-08 00:11:20

标签: jmeter taurus

我正在使用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文档),但是我不知道将它们显示在控制台上所需的配置。感谢任何帮助。

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

1 个答案:

答案 0 :(得分: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)

否则,您可以将Online Interactive Reportsconfigure your JMeter test to use Grafana and InfluxDB用作第三方指标存储和可视化系统。