0

In my Loadrunner program, I have an initialization block in vuser_init that modifies the value of a handle.

static int handle =0;
Init(&handle);

In this case the pointer to the handle is modified by the Init function. The modified handle is used by other functions as parameters within the Action block. The problem is that the static value of handle works for the first thread but not for others since they all read the same static value. What I need is a static value of handle per thread so that the Action block called during each iteration for a thread can get its own handle. Is there a way to save the handles into a list or map or some structure in C that is recognized by Loadrunner?

Jai
  • 319
  • 2
  • 9
  • 30

1 Answers1

0

Just build whatever C structure you want and use it. LoadRunner is ANSI C from the LCC compiler.

You could make a linked list as well as the add and delete functions global and just manage your handles that way. It's C. Shoot the moon and just implement it.

I am not sure what you mean by value of handle per thread? Do you mean per virtual user? I ask because a web virtual user can have more than one thread.

If you are looking for the capture of distinct dynamic session information per virtual user this is common and standard loadrunner functions can be used to capture information. This information can be passed to C functions or certainly saved in C variables.

If you are trying to tie something distinct to each thread within a single virtual user then you are likely going to be on a path to a DLL virtual in C/C++ built in Visual Studio with LoadRunner extensions (see Advanced topics in the VUGEN manual, building virtual users with Visual Studio)

James Pulley
  • 5,606
  • 1
  • 14
  • 14