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)
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: