?????? wrote:
thanks. i'll try subresult.
what's the 2nd option?
------------------ ???????? ------------------
??????:
"JMeter Users List"
<glin...@live.com>;
????????: 2023??3??2??(??????) ????7:16
??????: "JMeter Users List"<user@jmeter.apache.org>;
????: Re: How to save custom sample results?
?????? wrote:
> Hi excellent users,
>
>
> I've read
documentationhttps://jmeter.apache.org/usermanual/jmeter_tutorial.html and
searched a lot on 'jmeter plugins', but not found any useful answer.
> I created MySamplerGui extends AbstractSamplerGui and MySampler extends
AbstractSampler, and I want to have additional result fields that want to to show
in the commandline summary, and the 'summary report' listener. For example, my
service under test is an audio service that responses http multiple parts that can
either be audio or other text. The audioLatency is time when first part of audio
returned, despite the built in latency which means time of first part.
>
>
> So I also created MySampleResult extends SampleResult and declared the new
properties, and have MySampleResult sample(Entry entry) in MySampler.
> Now I'm able to add my sampler to test plan in gui mode but when adding a
'summary report', I cannot see my additioanl properties, nor can I enable them in
the 'Sample Result Save Configuration' dialog. seems this 'summary report' listener
cannot automatically show custom properties.
>
>
> Could anyone tell me the methods to get my custom fields in console and
csv summary? Or tell me if it is impossible without modifying existing jmeter
implementation. thanks!
>
>
>
> Best Regards,
> Yang
I think Summary Report
<https://jmeter.apache.org/usermanual/component_reference.html#Summary_Report>
columns are hard-coded
<https://github.com/apache/jmeter/blob/rel/v5.5/src/components/src/main/java/org/apache/jmeter/visualizers/SummaryReport.java#L80>
(at least as of JMeter 5.5 <https://www.blazemeter.com/blog/jmeter-5-5>)
therefore you won't be able to see any custom metrics which are not there.
private static final String[]COLUMNS = {
"sampler_label",//$NON-NLS-1$ "aggregate_report_count",//$NON-NLS-1$ "average",//$NON-NLS-1$
"aggregate_report_min",//$NON-NLS-1$ "aggregate_report_max",//$NON-NLS-1$ "aggregate_report_stddev",//$NON-NLS-1$ "aggregate_report_error%",//$NON-NLS-1$
"aggregate_report_rate",//$NON-NLS-1$ "aggregate_report_bandwidth",//$NON-NLS-1$ "aggregate_report_sent_bytes_per_sec",//$NON-NLS-1$ "average_bytes",//$NON-NLS-1$ };
So I can think of 2 possible options:
1. For each "part" you can call SampleResult.addSubresult()
<https://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html#addSubResult(org.apache.jmeter.samplers.SampleResult)>
function an
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
For additional commands, e-mail: user-h...@jmeter.apache.org
Create your own listener which will be aware of your custom properties
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
For additional commands, e-mail: user-h...@jmeter.apache.org