Performancing Metrics

Performance blog

Monday, June 7, 2010

Performance Testing in Cloud

Factors which needs to considered while defining performance strategy in Cloud

Elasticity:

Elasticity is the ability to scale up your system resources when needed, and scale down when not required. Here are two important measures of cloud elasticity: spin-up elasticity and spin-down elasticity.

Load testing always consider peak load scenarios while measuring the system performance where as in cloud we may also have to consider Peak, moderate and low level usage of transactions. Base lining the System performance under these various loads will help the administrator to take a decision while scaling up or scaling down the resources based on load.

Scalability

Scalability is the ability of an application to handle increased processing demand with increase of load.

Testing the scalability of an application is very important; if the application is not scalable then the elasticity of the cloud can actually cost thousands of dollars. When moving to the cloud, it becomes even important to test the applications and to tune them properly so they are optimized when it comes to hardware consumption

Bandwidth

Usually Cloud Providers are distributed across different geographical locations. Bandwidth testing using tools like Shunra Cloud will help to ensure bandwidth requirements between the endusers and the cloud provider

Some Cloud Platform providers provide the following usage information of your application this can also be used as a basis while defining performance strategy

• CPU

• Memory

• # of DML statements

• # webservice calls

• # Calculations

Thursday, May 6, 2010

Testing RESTful Web Services using LoadRunner

Brief overview of RESTful web services

REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages. If measured by the number of Web services that use it. REST has had such a large impact on the Web that it has mostly displaced SOAP- and WSDL-based interface design because it's a considerably simpler style to use.

From the standpoint of client applications addressing resources, the URIs determine how intuitive the REST Web service is going to be and whether the service is going to be used in ways that the designers can anticipate. A third RESTful Web service characteristic is all about the URIs.


REST Web service URIs should be intuitive to the point where they are easy to guess. Think of a URI as a kind of self-documenting interface that requires little, if any, explanation or reference for a developer to understand what it points to and to derive related resources. To this end, the structure of a URI should be straightforward, predictable, and easily understood.

One way to achieve this level of usability is to define directory structure-like URIs. This type of URI is hierarchical, rooted at a single path, and branching from it are subpaths that expose the service's main areas. According to this definition, a URI is not merely a slash-delimited string, but rather a tree with subordinate and superordinate branches connected at nodes. For example, in a discussion threading service that gathers topics ranging from Java to paper, you might define a structured set of URIs like this:

http://www.myservice.org/discussion/topics/{topic}

(Refer this article written by Alex Rodriguez on RESTful webservices for more information)

Sumilating RESTful web Services using LoadRunner


REST Services can be scripted using web_custom_request by adding appropriate headers using web_add_header function before the web_custom_request.

An example for REST services script is given below.


/*********************************

web_add_header ("X-ELS-APIKey","11111");

web_add_header ("X-Forwarded-For","12.5.28.133");

web_add_header ("Accept","text/xml");

web_custom_request("web_custom_request",

"URL=http://host:8080/content/abstract/*********",

"Method=POST",

"TargetFrame=",

"EncType=text/xml; charset=iso-8859-1",

"Resource=0",

"Referer=",

"Mode=HTTP",

"Body=",

LAST);

*****************************/

If you want to verify the response manually, you need to set up the header values first in your browser.

Please find below the steps for setting up the header using mozilla firefox browser.

  • Open firefox. Click "Add-ons" from tools menu
  • Click "get Add-ons" tab.
  • Type "HTTP header" in the text box for search all add-ons and enter.
  • In search results, click on "Add to firefox" for "Modify Headers 0.6.6" and install. Now you can see "Modify Headers 0.6.6" in the extension tab.
  • Click on "Modify Headers 0.6.6" from the "Extensions" tab and select the check box for "Always on" and "Open modify header in a new tab" and close.
  • Now click "Modify headers" from the firefox tools menu and add the appropriate header name and value for your request.

Now launch the URL in the firefox browser and verify the response manually.

Also refer RESTClient  addon available for firefox to test RESTful services

Wednesday, April 28, 2010

SAP BPC ToolKit for LoadRunner

This attached guide describes the process of using LoadRunner with SAP BusinessObjects Planning and Consolidation in detail.

DownLoad SAP BPC ToolKIT from the link below
http://docs.google.com/leaf?id=0BzOftuUbGkRvZGIzOTJhZTctNzQ3Ny00MmZhLTllY2EtNDY5Y2JjZDA5Yjk3&hl=en

Download LoadRunner Guide to test SAP BPC Application
docs.google.com/fileview?id=0BzOftuUbGkRvYzE4NjFjMzAtN2JlMi00YmVjLThkMDgtNDg4ZmRlN2NjZjJm&hl=en

Friday, April 23, 2010

Client Side certificates with LoadRunner

Many applications make use of the SSL extension to the HTTP protocol that adds an encryption layer to the HTTP stack. If performance test tool can't handle SSL then you won't be able to record any transactions.
One way of increasing security is to make use of client certificates, which can be installed into the application

client before access is permitted to an application. The certificates are provided in a number of formats (typically pfx or p12) and must be made available to your performance testing tool for successful capture and replay.
Please follow the steps below to import, export the certificate in the format recommended by LoadRunner.
 
Import Client Certificate in Browser

1. Click Start, click Control Panel, double-click Internet Options, and then click the Content tab

2. Click Certificates.

        a)The Certificates dialog box opens.
3. Click the Personal tab, and then click Import.

        a)The Certificate Import Wizard opens.
        b)On the Welcome page, click Next.

4. On the File to Import page, click Browse, select your certificate (if necessary, select your certificate type in Files of Type drop-down menu), and then click Next.

5. On the Password page, type the certificate’s password, select Mark this key as exportable, and then click Next.

6. On the Certificate Store page, select Place all certificates in the following store, browse to the Personal certificate store (if it’s not already selected), and then click Next.

7. On the Completing the Certificate Import Wizard page, click Finish.

8. Verify that the imported certificate appears in the Personal tab of the Certificates dialog box.

Export a private key

1. Under Internet Options, and then click the Content tab.

2. Click Certificates.

       a)The Certificates dialog box opens.
3. In the Certificates dialog box, click the Personal tab, select the certificate to export, and then click Export.

       a)The Certificate Export Wizard opens.
       b)On the Welcome page, click Next.

4. On the Export Private Key page, select Yes, export the private key, and then click Next.

5. On the Export File Format page, choose Personal Information Exchange – PKCS #12 (.PFX), select Include all certificates in the certification path if possible, clear the other check boxes, and then click Next.

6. On the Password page, type and retype the certificate’s password, and then click Next.

7. On the File to Export page, type the path and name of the file to export, and then click Next.

     a)The wizard will add the .pfx extension automatically.

8. On the Completing the Certificate Export Wizard page, click Finish.


Convert .PFX to .PEM format using OpenSSL

1. Download latest version of OpenSSL from OpenSSl Website

    a. http://www.openssl.org/source/

2. Convert PFX format to PEM format using the command below

a. OPENSSL PKCS12 –in <> -out <>

b. Enter the password given while exporting the certificate

c. Enter any PEM pass phase :e:g 2222

d. Reconfirm the pass phase by typing the same number again.

Open SSL
Note: SSL utility available in LoadRunner 9.5 may crash or may not work as intended. It is better to download the utility from OpenSSL website
 
WebServices Security in LoadRunner

Transport Level Security

Secure Sockets Layer (SSL) is a common transport layer approach that is used to provide encryption to message layer security. If your web service URL begins with https, SSL is automatically used.

  •  First copy the created .pem file using OpenSSL utility into LoadRunner Script folder
  • Set up the transport level security using the following function in LoadRunner
 web_set_certificate_ex("CertFilePath=testpem1111.pem",

"CertFormat=PEM",
"KeyFilePath=testpem1111.pem",
"KeyFormat=PEM",
"Password=2222", // PEM pass phase
LAST);

Note: if a web service doesn’t uses https URL then this function is not required in VuGen

Legacy Based Security

If in addition to SSL you are using message-level security (for example a username) then you must configure the security for the message separately using the Legacy/Scenario based security model (web_service_set_security) function.

When a SOAP message sends a request, those security credentials, known as security tokens, are placed in the SOAP message. When the Web server receives the SOAP request, it does not need to send additional requests to verify the integrity of the sender. The server verifies that the credentials are authentic before letting the Web Service execute the application. By not having to go back to the source of the credentials, this significantly improves the application’s scalability

VuGen allows you to create security tokens for your script. You can create multiple tokens and set their properties. After creating a token, you use it to sign or encrypt a SOAP message. When you add a security token to a SOAP message, it is added to the SOAP message in the form of an XML element in the WS-Security SOAP header.

a. LoadRunner supports different types of security tokens. The available tokens are

Username and Password, X.509 Certificate,Kerberos Ticket, Kerberos2 Ticket, Security Context Token, andDerived Token.

The information you need to provide differs for each token

b. This following is an example of legacy based security Model using User Name and Password token in LoadRunner

web_service_set_security(
SECURITY_TOKEN, "Type=USERNAME","LogicalName=DP", "UserName=XXXXXX", "Password=XXXXX", "PasswordOptions=SendPlainText", "Add=True",
LAST);

c. X.509 Certificate: When you add an X.509 token to the Vuser script, you specify the Logical Name, Store Name, Key identifier type, Key identifier value, and Store Location arguments.

These inputs to this function can be obtained by downloading Microsoft WSE X509 certificate tool from Microsoft website


web_service_set_security(
SECURITY_TOKEN, "Type=X509", "LogicalName=MyStore", "StoreName=My",
"IDType=SubjectName", "IDValue=C=US, S=CA, L=San Rafael, O=Inc., OU=IT, CN=IT Internal", "StoreLocation=CurrentUser", "Add=True",
MESSAGE_SIGNATURE, "UseToken=MyStore",
LAST);

Scenario based Security Model

LoadRunner also supports Scenario based Security Model for WCF Services which is out of scope of this post

Sunday, April 18, 2010

How to track the Application Session for Call Center and Partner center in Siebel

Here are the steps to check the Application Sessions for Siebel Call Center and Partner center.


1. Login to Call center

2. Click Site Map

3. Go to Administration => Server management

4. Click Components

5. Click Query

6. Query for “eChannel Object Manager (ENU_EIDM)” which is Partner Center Application

7. Running Tasks in the below image will give the current Sessions running against that Component for each Siebel Application Server


Call Center





8. Likewise perform the same query for “Call Center Object Manager (ENU)” which is call center application


9. Running Tasks in the below image will give the current Sessions running against that Component for each Siebel Application Server

Monday, April 12, 2010

Siebel Event logs

To tune performance in Siebel, you first need to get detailed events for the suspected component.


Set ‘Event Log Level’ to 5 for proper component:

1) In Call Center, navigate to Site Map > Administration  Server Configuration > Components > Events

2) Highlight the component for which you wish to turn the tracing on.

3) In the lower applet, select the event type and set the log level to 5.

Siebel Event logs
 
 
 
 
 
 
 
 
 
 
 
 

Wednesday, March 3, 2010

Sending Emails using Blat utility in LoadRunner

If there is any requirement where you may have to send hundreds of emails to the server then one option is to use a web email client to simulate the load but it has following limitations

1. Your own corporate/personal Email id need to be used in LoadRunner Script but it may fill up the mail box

2. Password credentials need to be made visible in the script.

Other option is to use Blat utility which is a third party freeware utility. It sends the contents of a file in an e-mail message using the SMTP protocol.

Download the attached blat.dll utility and create a sample script as shown below.


Action()

{
command_line_Send = (char *)malloc(1024 * sizeof(char));

if(CheckLoadBlatDLL != 0) //if return code not zero then DLL not loaded!!Reload it
{
    lr_output_message("BLAT Emailing DLL Not Loaded Successfully !!! Reloading the DLL");
    CheckLoadBlatDLL = lr_load_dll("blat.dll");
}
f1=fopen(lr_eval_string("C:\\SR_{vuser_id}.txt"), "wb+" );
fprintf(f1,lr_eval_string("Email Performace Testing {TimeStamp}"));
fclose(f1);

//Initialize all the command line parameters for Blat tool

strcpy(DestEmailID,lr_eval_string("{EmailId} ")); // Destination Email ID
strcpy(Subject,lr_eval_string("\"Email PerfTesting{TimeStamp}\" ")); // EmailID Subject
strcpy(SMTPServer,lr_eval_string("{SMTPServer}")); //Your Corporate SMTP Server
strcpy(FromEmailID,lr_eval_string("{FromEmailID} "));// Source Email Id
strcpy(AttachFile,"C:\\attach.pdf "); // Any attachment
strcpy(BodyText,lr_eval_string("C:\\SampleBody{vuser_id}.txt "));// Email Body
lr_output_message("The Destination EmailId is :%s",lr_eval_string("{EmailId}"));

//Verify whether DLL Loaded successfully

if (CheckLoadBlatDLL == 0) //if return code not zero then not DLL not loaded
{
    lr_output_message("BLAT Emailing DLL Loaded Successfully ");
    // Build the Command line for sending Emails
    strcpy( command_line_Send, BodyText);
    // strcat( command_line_Send, "-attach ");
    //strcat( command_line_Send, AttachFile);
    strcat( command_line_Send, "-to ");
    strcat( command_line_Send, DestEmailID);
    strcat( command_line_Send, "-f ");
    strcat( command_line_Send, FromEmailID);
    strcat( command_line_Send, "-s ");
    strcat( command_line_Send, Subject);
    strcat( command_line_Send, "-server ");
    strcat( command_line_Send, SMTPServer);
    lr_output_message("Parameters for Send Command : %s", command_line_Send);
    temp_error_code = Send(command_line_Send);
    lr_output_message("Return code of Send command %d " , temp_error_code);
  //Check successful message sending.
   if (temp_error_code == 0) {
      lr_output_message("Email Sent Successfully ");
   }
  if(temp_error_code != 0){
  switch( temp_error_code ){
  case 1:
   //Command Line Bad Argument
   //Unable to open SMTP socket
   //Command unable to write to socket
   //Server does not like To: address
   // Mail server error accepting message data
   lr_error_message("ERROR : Check the command Line Argument Format");
   break;
  case 2:
   //The server actively denied our connection.
   //The mail server doesn't like the sender name.
   lr_error_message("ERROR : Email Server Denied connection or File does not exist");
   break;
   }//end SWITCH
 }//end IF
}else{
  lr_output_message("Unable to Load the Blat DLL - Check whether DLL exists at the specified location ");
}
free(command_line_Send);
return 0;
}