Latest Entries »

Needed to stop a non-GUI Jmeter test today in a hurry as we discovered on of the webservers was configured to use the production DB. Luckily I remembered the stoptest but had wondred why It errored when given the IP address of the controller. Duh… That is because it requires a port number. For most of the time it is the default of 4445.

Today I wanted to use parameterized transaction names within a LoadRunner script. As I thought that a particular transaction was failing after a particular number of iterations. Luckily this was pretty simple in LoadRunner. It was just a case of using lr_eval_string in the call to the transaction wrapper.

lr_start_transaction(lr_eval_string("Do Something {pIteration}"));

lr_end_transaction(lr_eval_string("Do Something {pIteration}"), LR_AUTO);

You have to be careful above to make sure that start and end transaction names are the same. To overcome that problem I created a string variable to hold the LoadRunner transaction name.

char sTranName[20];

sprintf(sTranName,lr_eval_string("TransactionA_{pIteration}"));
lr_start_transaction(sTranName);

lr_end_transaction(sTranName,LR_AUTO);

Installing Jmeter for Ubuntu 11.10

Been playing with Jmeter running in Ubuntu 11.10, The first thing I needed to do was install Jmeter. I started running the following command to install Jmeter.

sudo apt-get install jmeter

This installs Jmeter but unfortunatly version 2.3.4 while I wanted to do some stuff with version 2.6. So I download the current .tgz binary files from the web and used tar -zxvf *.tgz to extract out the files. Unlike the windows version where you can just click the jmeter.bat file you need to change the permission on the jmeter shell file. This requires chmod +xX jmeter on the jmeter file. Finally from the terminal just type jmeter and it starts!

I have been reading SQL Server Secret Diary by Vijayan and Kirsh.

Here are a few snipets of performance wisdom from them.

It says where multiple variables are set for Microsoft SQL server the a SELECT statement is faster than several SET statements e.g
SET @employeeid = @employeeid+1, @a=2
Is faster than
SET @employeeid = @employeeid+1,
SET @a=2

Here is another tip when if you want to count the rows in a table quickly. Rather than just
select count(*) from dbo.tablename
Which would do a complete table or cluster index scan. Try this to extract the data from sysindexes
SELECT rows FROM sysindexes
WHERE Id = OBJECT_ID('dbo.tablename') AND indid < 2

To help speed up the performance of a stored procedure remember to add.
SET NOCOUNT ON
This avoids sending row count information for every statement

Been awhile since doing anything with jmeter and the first time against a ASP.NET application. Don’t ask me how I managed to avoid it for so long! Anyway I needed to pull out the viewstate to correlate the script. Due to the power of the Internet I found this on how to set up the Regular Expression Extractor.

However, it didn’t work for me. I ended up using this __VIEWSTATE" value="(.+?)" /> without any problem although it may not be an efficient.

Been sent to take over from a performance test contractor that had been doing some Performance testing of a thick client application. The LoadRunner scripts are essentially C scripts making API calls to the application. They are huge and although there is little logic in them difficult to understand from the obscure API calls. Still that comes with the territory of a performance tester.

BUT, what is missing is the original documented click scripts through the application. All I have to work on are the transaction names. So please fellow performance testers leave the click script documentation around before you leave the project!

A customer I was doing some performance testing for wanted to know how many particular transactions where being processed at any one time. Within their DB they capture the start time and end time of the transaction. So, I thought I could give them an indication of concurrency if I could construct a SQL query to extract and process the data.

Here is a a example that I have constructed in a simple MySQL DB (rather than use their data). For this purpose a table called log containing start and end time.

.

Here is the code I wrote. Any optimisation to the SQL welcome. (I am but a performance tester interested in the data)


SELECT tL.StartTime, (select count(1) from test.Log where StartTime = tL.StartTime) FROM test.Log tL where StartTime > 0 group by StartTime order by 1

Here is the output from running the query. It should be noted that it presents the concurrency at the start time of a new transaction.

I have been doing some performance debug work with fiddler recently and I wanted to add some timers to the java script which I am debugging via using an auto responder.

For the JavaScript I am interested in I added the function below at the top of the script.

function now()
{
var d = new Date();
return (d.getTime());
}

At the beginning of the function I want to time I added

var time = now();

At the end of the function I added

alert(“Time to execute = ” + (now()-time)+”);

Expanding LoadRunner functions

I quickly wanted to get some lr_status message outputted to the console for every LoadRunner transaction in a script, I basically wanted to insert a status message every time the lr_start_transaction was called to output the transaction name to the console. however, it was a large script and I didn’t want to make any code changes to the load runner script. So I wanted to expand the existing function. The code below was added into the vinit section.

void my_start_transaction (char *name)
{
lr_vuser_status_message("Starting Transaction %s",name);
lr_start_transaction(name);
return ;
};
vuser_init()
{

#define lr_start_transaction(x) my_start_transaction(x)

return 0;
}

LoadRunner Function Override

Another example of a website that may not have been properly performance tested.

Ticket Crash

Follow

Get every new post delivered to your Inbox.