- load generator name
- vuser id
- iteration number
- timestamp
This can be done easily as follows:
- get load generator name using lr_get_host_name()
- get vuser id using lr_whoami()
- get iteration number using a parameter of type iteration
- get current timestamp using lr_save_datetime()
The following script shows how to do this.
Script
Action()
{
int id
char *host;
// get load generator name
host = lr_get_host_name( );
//lr_output_message("Host: %s", host);
// get vuser id
lr_whoami(&id, NULL, NULL);
//lr_message( "Vuser id: %d", id);
// for iteration add a parameter named "Iteration" of type Iteration
//lr_output_message(lr_eval_string("Iteration: {Iteration}"));
// get timestamp, formatted as wanted
lr_save_datetime("%m-%d-%Y-%I%M%S%p", DATE_NOW, "now");
//lr_output_message(lr_eval_string("Time: {now}"));
// now generate the nice, readable unique id
lr_output_message(lr_eval_string("Host-%s-VuserId-%d-Iteration-{Iteration}-Time-{now}"),host, id);
return 0;
}
Output
Action.c(20): Host-generator02-VuserId-1-Iteration-1-Time-09-13-2012-035856PM [MsgId: MMSG-17999]
Action.c(20): Host-generator02-VuserId-2-Iteration-1-Time-09-13-2012-035856PM [MsgId: MMSG-17999]
Action.c(20): Host-generator02-VuserId-1-Iteration-2-Time-09-13-2012-035857PM [MsgId: MMSG-
Action.c(20): Host-generator02-VuserId-2-Iteration-2-Time-09-13-2012-035857PM [MsgId: MMSG-17999
Action.c(20): Host-generator02-VuserId-1-Iteration-3-Time-09-13-2012-035858PM [MsgId: MMSG-17999]
"Fantastic post! Our java training online
ReplyDeletemake you job-ready with practical coding challenges and real-world applications."
"Enhance your career with sfdc admin training
ReplyDeletemastering Salesforce administration, workflows, and data management. Gain hands-on skills to efficiently manage Salesforce platforms and drive business success."
An iOS course introduces mobile development concepts clearly. It focuses on real-time learning. Practice strengthens skills. Learners build applications. This ios course supports success. It is effective.
ReplyDeleteAn ios programming course teaches Swift and iOS frameworks in detail. It supports hands-on coding practice. This ios programming course builds strong programming skills. It is dependable.
ReplyDelete"Great post! Our java training online
ReplyDeleteteaches core concepts and advanced techniques, preparing you for a successful career in software development."