Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test Results file name Format in Date and Timestamp in Jmeter

Tags:

jmeter

How do i generate the results CSV ,jtl files automatically with the date and time format?

Basically what i am trying to looking for generating the Test results files CSV and jtl files automatically with the date and time stamp and pass that results file in the Graphs Generator , so that I don't need to keep modify the jmx files.If possible Graphs output folder also with the date and time stamp.

How do I achieve this?

please see the below screenshots enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

2017/04/05 16:07:49 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2017/04/05 16:07:49 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2017/04/05 16:07:49 ERROR - jmeter.engine.PreCompiler: invalid variables org.apache.jmeter.functions.InvalidVariableException: Expected } after __time function call in C:\JMETER\LR2JMeter\NGP\Results\NGP_PensionReport\PR_ViewResultsTable_${__time(YMDHS),}.csv at org.apache.jmeter.engine.util.FunctionParser.makeFunction(FunctionParser.java:139) at org.apache.jmeter.engine.util.FunctionParser.compileString(FunctionParser.java:82) at org.apache.jmeter.engine.util.CompoundVariable.setParameters(CompoundVariable.java:189) at org.apache.jmeter.engine.util.ReplaceStringWithFunctions.transformValue(ReplaceStringWithFunctions.java:46) at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:170) at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:80) at org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:78) at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996) at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:997) at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978) at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:306) at java.lang.Thread.run(Unknown Source)

Please advise me!

Thanks, Rajani

like image 242
rpagadala Avatar asked Apr 05 '17 19:04

rpagadala


People also ask

What is the correct format of JMeter file?

Results can be read from XML or CSV format files. When reading from CSV results files, the header (if present) is used to determine which fields were saved. In order to interpret a header-less CSV file correctly, the appropriate JMeter properties must be set.

What is timestamp in JMeter report?

__time() function in JMeter This function is used to generate the current timestamp in different formats. __time() has two arguments i.e. Time Format and Name of Variable and both are optional. __time() function without any argument returns the current time in epoch format.

What is the file format in which the JMeter scripts are stored?

By default, JMeter saves the test results in csv format without storing the response data.

How timestamp is handled in JMeter?

Solution: JMeter function time() generates timestamp in epoch format in millisecond i.e. 13 digits numbers like 1559815879767. Sometimes there is a requirement to pass the current timestamp in second i.e. 10 digits numbers like 1559815879.


1 Answers

Use below syntax to name your file. You can use this cheat sheet, if you want to change the format.

For more details about functions, please check this link.

${__time(MM-dd-yyyy-HH-mm-ss,)}
like image 79
NaveenKumar Namachivayam Avatar answered Sep 23 '22 07:09

NaveenKumar Namachivayam