如何禁用/排除显示在报告中的特定步骤 - Jmeter非GUI操作

时间:2018-01-17 07:22:12

标签: groovy jmeter report

我对Jmeter报告有疑问, 我有一个包含jdbc / Jssr223 / HTTP采样器的线程。 其中一个步骤是循环,迭代2000次,内部存在HTTP + Jssr223采样器。 我通过命令行在非UI模式下运行测试,而不是在csv中看到结果。 问题是我不需要来自该循环的所有响应,但是我希望看到来自其他步骤的所有响应。 他们是否有办法禁止步骤出现在报告中?或禁止整个循环结果出现在报告中。 问题是当我运行多线程并且CSV不可读时。存在一种不写具体步骤的报道方式。 提供了我的属性+测试中循环的Pic

enter image description here

#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------

# This section helps determine how result data will be saved.
# The commented out values are the defaults.

# legitimate values: xml, csv, db.  Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=csv


# true when field should be saved; false otherwise

# assertion_results_failure_message only affects CSV output
#jmeter.save.saveservice.assertion_results_failure_message=true
#
# legitimate values: none, first, all
#jmeter.save.saveservice.assertion_results=all
#
#jmeter.save.saveservice.data_type=true
#jmeter.save.saveservice.label=true
#jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
#jmeter.save.saveservice.response_data=false
# Save ResponseData for failed samples
#jmeter.save.saveservice.response_data.on_error=false
#jmeter.save.saveservice.response_message=true
#jmeter.save.saveservice.successful=true
#jmeter.save.saveservice.thread_name=true
#jmeter.save.saveservice.time=true
#jmeter.save.saveservice.subresults=true
#jmeter.save.saveservice.assertions=true
#jmeter.save.saveservice.latency=false
# Only available with HttpClient4
#jmeter.save.saveservice.connect_time=false
#jmeter.save.saveservice.samplerData=true
#jmeter.save.saveservice.responseHeaders=true
#jmeter.save.saveservice.requestHeaders=true
#jmeter.save.saveservice.encoding=false
#jmeter.save.saveservice.bytes=false
# Only available with HttpClient4
#jmeter.save.saveservice.sent_bytes=false
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=false
#jmeter.save.saveservice.sample_count=false
#jmeter.save.saveservice.idle_time=false

# Timestamp format - this only affects CSV output files
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS

# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters.
# Default:
#jmeter.save.saveservice.default_delimiter=,
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.saveservice.default_delimiter=\t

# Only applies to CSV format files:
# Print field names as first line in CSV
#jmeter.save.saveservice.print_field_names=true

# Optional list of JMeter variable names whose values are to be saved in the result data files.
# Use commas to separate the names. For example:
#sample_variables=SESSION_ID,REFERENCE
# N.B. The current implementation saves the values in XML as attributes,
# so the names must be valid XML names.
# Versions of JMeter after 2.3.2 send the variable to all servers
# to ensure that the correct data is available at the client.

# Optional xml processing instruction for line 2 of the file:
# Example:
#jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="../extras/jmeter-results-detail-report.xsl"?>
# Default value:
#jmeter.save.saveservice.xml_pi=

# Prefix used to identify filenames that are relative to the current base
#jmeter.save.saveservice.base_prefix=~/

# AutoFlush on each line written in XML or CSV output
# Setting this to true will result in less test results data loss in case of Crash
# but with impact on performances, particularly for intensive tests (low or no pauses)
# Since JMeter 2.10, this is false by default
#jmeter.save.saveservice.autoflush=false

2 个答案:

答案 0 :(得分:0)

如果您的问题是关于Core JMeter(而不是ant)生成的Web报告,那么只需设置您想要处于报告中的交易来设置此属性:

  

jmeter.reportgenerator.exporter.html.series_filter = ^(搜索|在线订单)( - 成功| -failure)$

确保您应用命名约定:

Apply naming policy

最后以此为例:

Naming policy applied

答案 1 :(得分:0)

您可以使用Filter Results Tool排除您不需要的任何结果,例如:

def get_available_dates():
    dates = next_x_months(12)
    weds = [last_wednesday(year, month) for year, month in dates]
    choices = list()
    for i, wed in enumerate(weds):
        booking_total = Booking.objects.filter(booking_date=wed)
        total = booking_total.count()
        if total < 6:
            choices.append((wed, wed,))            
    return choices

它会生成一个包含排除采样器的新报告,您可以通过FilterResults.bat --output-file new.jtl --input-file old.jtl --exclude-label-regex true --exclude-labels "regular-expression-to-filter-unwanted-labels" Perl5-style regular expression指定

您可以使用JMeter Plugins Manager

安装过滤结果工具

JMeter Plugins Manager Filter Results