0

I have build a jMeter test for a mobile web application. The test works perfect and i would see how much data a request cost for the mobile data bundle of the user. Is it possible ?

Janp95
  • 534
  • 8
  • 27

2 Answers2

1

For downloaded data there are 2 ways to achieve this:

  1. Approximation of downloaded data: Summary Report has

    Avg. Bytes - average size of the sample response in bytes.

    You could use its value to approximate how much data is downloaded by summing up # Samples x Avg. Bytes over all requests.

  2. If you want more precision, and estimation of both uploaded and downloaded data, you can use one of the programmable listeners (BeanShell listener, BSF Listener or JSR223 Listener) and collect this stats by yourself: they all have access to SampleResult, which allows you to collect the size of the uploaded data (sampleResult.getSamplerData().length()) and the size of the downloaded data (sampleResult.getHeadersSize() + sampleResult.getBodySize()). You can then write this data into file (this is an example for BeanShell)

Community
  • 1
  • 1
timbre timbre
  • 12,648
  • 10
  • 46
  • 77
0

Add next 2 lines to user.properties file (it is located under /bin folder of your JMeter installation)

jmeter.save.saveservice.print_field_names=false
jmeter.save.saveservice.bytes=true

It will "tell" JMeter to store response size and also adds a header to generated .jtl file when you run your test in command-line non-GUI mode so you could figure out which columns stands for which metric.

You'll need to restart JMeter to pick the properties up.

You'll get something like:

JMeter Save Service

So you will be able to use Excel or equivalent to sum all the "bytes" lines up and calculate the associated cost.

See Apache JMeter Properties Customization Guide for more information on what else can be controller with JMeter properties and what needs to be done to apply the changes.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133