0

I have a scenario and need load runner to give me a report in a specific format.

Scenario: I have an excel sheet with 1000 SQLs. 1 SQL in each row. I want load runner to pick this SQLs and run it with different users (say 3 users at a time) simultaneously. For example, User1 picks SQL1, User2 picks SQL2 & User3 picks SQL3. Now the user which finishes first will pick the next SQL, say for example User2 finished first, then it will pick SQL4 and so on till all SQLs are exhausted.

Report: In the final report I need the following: For each SQL - User which executed the SQL, SQL, Start Time, End Time, Response Time. For all SQLs (overall): CPU Usage, Memory Usage, Disk Usage of the Server. The report format can be anything, txt or excel.

Thanks, Alok

3 Answers3

0

Are you saying you created this scenario and are having trouble with it? If so, what problems are you running into specifically? Or are you asking if this is possible?

The scenario you describe is certainly possible, you could set up a data file in the parameter list of your script full of your SQL commands and use the 'Unique' setting to divide up the SQL statements run and ensure they don't use the same ones. It is possible to create custom reporting output in LoadRunner too. You can create functions in your script to output custom report data using the lr_user_data_point() function. The output looks like any other timeline data tracking report in the Analysis tool.

Nathan
  • 341
  • 1
  • 4
0

The natural question to ask given that this is your first question, what is your level of training with the tool? The solution set leverages the parameterization engine which is covered extensively as a part of training for the tool, as well as the transaction timing model, which is also covered as a part of standard product training. If you have been asked to accomplish this without training in tools, process and a period of mentoring then your odds of success asymptotically approach zero.

The solution path: VB Template virtual user. You will need to validate that your license allows for the use of the template virtual user option. This is also a programmatic solution so you will need to have appropriate VB skills. The same could be accomplished with a Java Virtual User and also a C virtual user with greater difficultly. The standard database virtual user would not be appropriate here as you have SQL with presumably different number of columns in the result set, therefore you need a solution set which allows for flexibility in the receipt of results rather than the hardcoded expectation model found in a native database virtual user.

Have a parameter file with two columns: Column 1 is the short name for the transaction, Column 2 the query. Distribute your SQL queries uniquely amongst your virtual users.

Your virtual User pcode

Init
{
Establish connection to the database server
}

Action
{
Rendezvous (policy, wait for at least 3)
delay a random number of milliseconds between 250 and 500 to account for human chaotic behavior
Start Transaction (Column 1)
Run My Query (Column 2)
Logic to pass pass|fail of transaction (End Transaction - PASS|FAIL)
}

End
{
Close my database connection
}

You should be aware that users do not operate on a simultaneous basis where everyone does something at exactly the same time. There may be users running concurrent to one another, but true simultaneity in which is everyone does the same thing at the same time requires synchronization to a clock tick. Humans are chaotic instruments and are not tied to an internal clock synchronous with others.

For the CPU, disk and other metrics tied to your SQL you will want to take advantage of the SQL profiling tools available for your database platform. For ORACLE, this is an AWR report. For Microsoft SQL Server, it is the aptly named SQL Profiler tool. Sybase, DB2, MySQL, etc... all have the same tool capability, it's just a matter of digging it out of their admin toolkit.

If you simply want to monitor the server during the test, then that is straightforward. Take a look at the SiteScope integration to LoadRunner. 500 points of Sitecope has shipped with each version of LoadRunner since version 8.1. You can also query tables directly, such as the V$ tables in ORACLE or the system tables in Microsoft/Sybase SQL server, and then create DataPoints for information you wish to track.

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

click on parameters options in explorer , now click new parameter and name it sql queries.

  1. click edit with notepad
  2. populate with your sql queries.
  3. save and set the parameter settings to unique each iteration and below it abort vuser. 4 now every user will pick unique value one after another as you want it to be and if ran out of values will stop running
njwin07
  • 103
  • 2
  • 14