jmeter does not flush aggregate report entirely - Stack Overflow

admin2025-04-17  3

In my jmeter project I have created a JSR223 Sampler in my tearDown Thread Group. This groovy script creates a summary report of all the response times with additional info that I need. The input for this script is the aggregated report (.csv file) generated by jmeter listener from the main thread.

I have noticed that the generated file of the aggregated report is not completed flushed (written to disk), when I am in the tearDown script. In the tearDown I have this statements:

def lines = new File(input_file).readLines()
log.info "************* Number of lines in input file: " + lines.size() + " *************"
sleep(30000)

While the test is running I open the file in VSC. I can see that not all lines are in file yet. Only when jmeter is closed, then the file is completely written to the disk.

I am executing the test from the command line.

How do I force jmeter to flush the file? Or is there another way that I create my summary report in the lay-out that I need from jmeter?

I have isolated where the issue is that I am not getting the expected number of samples and the timing of completing the aggregate_report.csv file by jmeter

log.info "************* Number of lines in input file: " + lines.size() + " *************"
sleep(30000)

In my jmeter project I have created a JSR223 Sampler in my tearDown Thread Group. This groovy script creates a summary report of all the response times with additional info that I need. The input for this script is the aggregated report (.csv file) generated by jmeter listener from the main thread.

I have noticed that the generated file of the aggregated report is not completed flushed (written to disk), when I am in the tearDown script. In the tearDown I have this statements:

def lines = new File(input_file).readLines()
log.info "************* Number of lines in input file: " + lines.size() + " *************"
sleep(30000)

While the test is running I open the file in VSC. I can see that not all lines are in file yet. Only when jmeter is closed, then the file is completely written to the disk.

I am executing the test from the command line.

How do I force jmeter to flush the file? Or is there another way that I create my summary report in the lay-out that I need from jmeter?

I have isolated where the issue is that I am not getting the expected number of samples and the timing of completing the aggregate_report.csv file by jmeter

log.info "************* Number of lines in input file: " + lines.size() + " *************"
sleep(30000)
Share Improve this question asked Jan 30 at 16:44 SaidSaid 335 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

There is a property jmeter.save.saveservice.autoflush which is false by default.

So if you add the next line to user.properties file:

jmeter.save.saveservice.autoflush=true

the sample results will be immediately added to the .jtl results file as soon as they're there.

More information:

  • Configuring JMeter
  • Results file configuration
  • Apache JMeter Properties Customization Guide
转载请注明原文地址:http://anycun.com/QandA/1744904528a89271.html