How to get the sim-time-limit from result files? - omnet++

Apparently, OMNeT++ (i.e. version 5.1) does write every parameter and attribute into the result files, except for sim-time-limit. I checked .sca, .vec and .vci files for it, but it is not included.
I was able to write the warmup-period into the files by making it a named iteration variable but this does not work for sim-time-limit (see Errors while variable arithmetic in configuration file).
Is there any possibility to get this value written into the result files? I coulnd't find anything in the manual.

I have successfully recorded it by defining it as an iteration variable
sim-time-limit = ${timelimit= 90min}
This will write out
itervar timelimit 90min
in the .sca file.

To get sim-time-limit as a double value at the runtime:
cConfigOption simTimeConfig("sim-time-limit", true,cConfigOption::Type::CFG_DOUBLE, "s", "300", "");
double maxSimTime = cSimulation::getActiveSimulation()->getEnvir()->getConfig()->getAsDouble(&simTimeConfig);
Source:
https://syntaxsugar.de/posts/omnetpp-reading-parameters/

Related

C - Not reading the integer variable in GetProfileInt() function in windows 7

I am using the getprofileInt() function in C for CAPL scripting, but here it is not taking the variable value defined in ini file. Its taking only default value. This is my code:
int ESPV_hex,BCM1var,BCM1Hex;
Gateway_72_msgrequest()
{
BCM1var =getProfileInt("CONFIG_SIGNAL","BCM1_ASSUEN_TEMP_UNGEF",0xFF,"SIGNALvalue_list.INI");
write("BCM signal input value %d",BCM1var);
write("BCM signal input value %x",BCM1var);
Gateway_72_Dlc8.byte(7)=BCM1var;
output(Gateway_72_Dlc8);
}
; File: SIGNALvalue_list.ini
; Contains the list of all Signals values.
[CONFIG_SIGNAL]
BCM1_Waschwasser_Sensor=10
The name of the function is GetProfileInt, not getProfileInt as you have it in your code
GetProfileInt only takes three parameters, whereas you pass four parameters, so the signature is not compatible
GetProfileInt only works with the win.ini file. You might prefer using GetPrivateProfileInt which lets you specify the .ini file to use
If you are using GetPrivateProfileInt to specify the .ini file, you really should specify the full file path to the .ini file. Otherwise the system will only look for it in the Windows directory.

JMeter SMTP Sampler - is it possible to use parameterization with in "attach files" option?

am using JMeter 4.0 and I have been trying to parameterize the filename in "Attach files" option with no success. I am required to use attachments of varying sizes and with each loop a random pdf file (from the set of files saved locally in d drive) to be attached with the email.
I am using a CSV data set config for parameterization and see no issues in using the parameters in Subject line of within the Message.
However, when used with the attach files option, the JMeter test fails to execute with FileNotFoundException as the variable name is substituted as such instead of the pdf filename. Is there a solution?
Error Message: java.io.FileNotFoundException: D:\Data_Jmeter\${AttachFile}.pdf (The system cannot find the file specified)
I cannot reproduce your problem using the following settings:
Where ${path} is set via User Defined Variables on Test Plan level and resolves into "bin" folder of my JMeter installation
The same situation for ${path} variable originating from the CSV Data Set Config
So I would recommend to double check if your ${AttachFile} variable is defined, you can do this using Debug Sampler and View Results Tree listener combination

Jmeter - store variable data for an hour

Is there a way to access Jmeter variable data even after tests are run?
This is what i am looking for:
Run a test, store the data in a variable (test finishes in 2 mins)
Idle for 15 mins
Run another test
i want the variable in step 3, Without running step1 again.
The most straightforward choice is saving the variable(s) you need into JMeter's .jtl results file using Sample Variables property. In order to "tell" JMeter to save certain variable value you need to add the next line to user.properties file:
sample_variables=your_variable_name
Alternatively you can pass this property value using -J command-line argument
jmeter -Jsample_variables=your_variable_name -n -t ....
Once done you should see an extra column in the .jtl results file holding your variable values. You should be able to access these values using i.e. CSV Data Set Config.
See Configuring JMeter user manual chapter for more details.
Variables are per test. You need to use a resource as file.
Use propert file to save and load variable as follows:
Start jmeter with property file as -q my.properties
On your test check if property exists if exists skip step 1
If not - do step 1 and then add the variable to property file line as propName=propValue
See example

How do I pass in a parameter value to a vbscript I want to run

I am trying to write a script to create a flg file after a filemovement that is empty but just indicates the file moved before it has been sent successfully. Since this will be used repeately for many differnt file movements with many different destination locations and many differnt names for the flg file, I want to send in parameters to the script.
I have successfully gotten the script to create the file if I hardcode the directory and filename values. But I can't figure out how I would sent the variable values that my MoveIt task has already defined and populated into the script to be the values of strDirectory and strFile variables in the script.
I tried just setting the parameters for the process in MoveIt using the same name as the variables in the script and that didn't work.
I tried something called WScript.Arguments, and that didn't work:
strDirectory = Wscript.Arguments.Item(0)
strFile = Wscript.Arguments.Item(1)
Not sure what else to try.
Use MIGetTaskParam(ParamName) inside the VB script and pass the directory and file names as parameters on the script itself.
For example, on the process step add a parameter called "PATH" and populate it with the macro [FullPath].
Inside the script get the value with something like:
myfullpath = MIGetTaskParam(PATH)
Unfortunately there is not a macro that will give you just the full path without the filename, so you'll have to split it up in VB yourself.

Using user defined variables in the path of a results file in JMeter

I want to write a results CSV file in JMeter which contains a variable in path of the file I write.
E.g.
C:\\Users\\User1\\test-results\\${output}.csv
But I only seem to be able to use predefined variables like ${__time(ddMMyyHHmmss)}
Is there a way to use user defined variables in the path? I have successfully done this to find input files by defining the variable in the test plan node as a User Defined Variable.
I managed to use user defined variable in the path of result file using JMeter 2.9. REPORT is a user defined variable with value REPORT. It gives me file named REPORT.csv
In JMeter 3.1(?) (or Windows?) a double slash is required in the path.
I have used the following successfully:
c:\\jmeter\\results\\${testId}\MyReport.csv
c:\\jmeter\\results\\${testId}\MyReport.csv
c:\\jmeter\\results\\${__time(yyyyMMddHHmm)}\MyReport.csv
c:\\jmeter\\results\\${__time(yyyyMMddHHmm)}.csv
${testId} is a User Defined Variable configured in the Test Plan and set to ${__time(yyyyMMddHHmm)}

Resources