1
votes

It started as some relatively simple thing... formatting the epoch timestamp on listener output file. on default behavior it gives you 13 digit epoch timestamp. but i want it to be human readable formatted string.

the obvious solution is to uncomment the following line in the jmeter.properties file:

jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS

However, this is true to just a single test plan i run, i don't want to change this behavior by editing properties file every time (really inconvenient and requires a restart every time when i want to switch to tests plans in which i do want the epoch time to work with digits)

so i tried to override this property in every single way, and failed. i tried using beanshell script or javascript (in preprocessors, postprocessors, jsr223 samplers etc...) to change it using vars.setProperty or using __setProperty jmeter function all failed.

also saw somewhere i can pass it as runtime argument, but i start jmeter using some batch file that fails every time i try to pass the line on cmd.

Is there any way to change this property dynamically from inside the jmx file? or am i doomed to forever edit the properties file and restart jmeter every time i switch my testPlans... (since in some of them i actually do want epoch timestamp)

thanks tal

1

1 Answers

0
votes

In Non-GUI mode, pass the value as JMeter Property using -J as follows:

jmeter.bat -n -t "examples\Debug Sampler.jmx" -l examples\log.jtl -Jjmeter.save.saveservice.timestamp_format="yyyy/MM/dd HH:mm:ss.SSS"

and it worked for me.


Within the Test Plan using __setProperty, I am not aware of any solution/work around. Changing the JMeter property, timestamp_format, does not result in saving the results in the changed format.