Wednesday, October 2, 2013

Splunk Search History


For people like me -

Wondering what query you used for Search in Splunk few days back?

Try -  index=_audit action=search search=* user=userid and change time to the custom timeframe

Monday, September 30, 2013

Run JavaScript from Vugen - web_js_run

web_js_run runs the specified JavaScript from LoadRunner Vugen. Consult the function reference for more details. This is supported from LoadRunner 11.5 onward.

I will be providing a working example below.


Action()
{
web_js_run(
"Code=getQuotes(LR.getParam('symbol'));",
"ResultParam=param",
SOURCES,
"File=XMLHTTPRequest_sync_sample.js"ENDITEM,
LAST);

return 0;
}


Create the below XMLHTTPRequest_sync_sample.js under Extra Files

var req2;
function getQuotes(mySymbol)
{
var myURL=
'http://download.finance.yahoo.com/d/quotes.csv?s=' + mySymbol + '&f=nsl1op';
req2 = false;
// branch for native XMLHttpRequest object
try {
req2 = new XMLHttpRequest();
catch(e) {
req2 = false;
}
if(req2) {
req2.open("GET", myURL, false);
req2.send("");
}
return req2.responseText;
}

Some data you can use for symbol parameter :

symbol
FLWS
FCTY
FCCY
SRCE
FUBC
VNET
JOBS
EGHT
AVHI
SHLM
AAON
ASTM
ABAX
ABMD
AXAS
ACTG
ACHC
ACAD
ACST
AXDX

Sample output.log from the execution:

Starting iteration 1.
Notify: max connections per server : 2
Starting action Action.
Action.c(3): web_js_run started   [MsgId: MMSG-26355]
Action.c(3): Started Sync download of URL="http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op"   [MsgId: MMSG-26000]
Action.c(3): t=1588ms: Connecting [0] to host xx.xx.xxx.xx:80   [MsgId: MMSG-26000]
Action.c(3): t=1614ms: Connected socket [0] from yy.yyy.yy.yy:33504 to xx.xx.xxx.xx:80 in 25 ms   [MsgId: MMSG-26000]
Action.c(3): t=1614ms: 249-byte request headers for "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op" (RelFrameId=1, Internal ID=1)
Action.c(3):     GET /d/quotes.csv?s=FELE&f=nsl1op HTTP/1.1\r\n
Action.c(3):     User-Agent: Mozilla/5.0 (compatible; MSIE ; Windows; Trident/4.0)\r\n
Action.c(3):     Accept-Encoding: gzip, deflate\r\n
Action.c(3):     Accept-Language: en-US,en;q=0.5\r\n
Action.c(3):     Accept: */*\r\n
Action.c(3):     Connection: Keep-Alive\r\n
Action.c(3):     Host: download.finance.yahoo.com\r\n
Action.c(3):     \r\n
Action.c(3): t=1646ms: 538-byte response headers for "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op" (RelFrameId=1, Internal ID=1)
Action.c(3):     HTTP/1.1 200 OK\r\n
Action.c(3):     Date: Mon, 30 Sep 2013 23:16:06 GMT\r\n
Action.c(3):     Set-Cookie: B=3vbfeq994k1hm&b=3&s=cf; expires=Thu, 01-Oct-2015 23:16:06 GMT; path=/; domai
Action.c(3):     n=.yahoo.com\r\n
Action.c(3):     P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PS
Action.c(3):     D IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV IN
Action.c(3):     T DEM CNT STA POL HEA PRE LOC GOV"\r\n
Action.c(3):     Cache-Control: private, no-cache, no-store\r\n
Action.c(3):     Expires: -1\r\n
Action.c(3):     Pragma: no-cache\r\n
Action.c(3):     Connection: close\r\n
Action.c(3):     Transfer-Encoding: chunked\r\n
Action.c(3):     Content-Type: application/octet-stream\r\n
Action.c(3):     \r\n
Action.c(3): t=1660ms: 9-byte chunked response overhead for "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op" (RelFrameId=1, Internal ID=1)
Action.c(3):     000002e\r\n
Action.c(3): t=1660ms: 7-byte chunked response overhead for "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op" (RelFrameId=1, Internal ID=1)
Action.c(3):     \r\n
Action.c(3):     0\r\n
Action.c(3):     \r\n
Action.c(3): t=1668ms: 46-byte chunked response body for "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op" (RelFrameId=1, Internal ID=1)
Action.c(3):     "Franklin Electric","FELE",39.40,38.47,38.91\r\n
Action.c(3): t=1669ms: Closing connection [0] to server download.finance.yahoo.com - server indicated that the connection should be closed   [MsgId: MMSG-26000]
Action.c(3): t=1670ms: Closed connection [0] to download.finance.yahoo.com:80 after completing 1 request   [MsgId: MMSG-26000]
Action.c(3): t=1670ms: Request done "http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op"   [MsgId: MMSG-26000]
Action.c(3): Ended synchronous download of URL="http://download.finance.yahoo.com/d/quotes.csv?s=FELE&f=nsl1op"   [MsgId: MMSG-26000]
Action.c(3): Synchronous download ended/terminated with any other pending request(s). Synchronous downloads count=0   [MsgId: MMSG-26000]
Action.c(3): Notify: Saving Parameter "param = \"Franklin Electric\",\"FELE\",39.40,38.47,38.91\r\n".
Action.c(3): web_js_run was successful, 46 body bytes, 538 header bytes, 16 chunking overhead bytes   [MsgId: MMSG-26385]
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.





How to increase HTTP connection limit in LoadRuner


Default is 2 as you can see from the output.log

Notify: max connections per server : 2

Use the below function to increase it from say 2 to 6.

web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","6");




Unable to start Glassfish server

In case you are not able to start the Glassfish server from netbeans, please try the below options.


  1. Find out which process is using the port and then kill the other process from task manager.
netstat -aon | find ":80" | find "LISTENING" -> this should help you locate the process id.
    2. Go to Glassfish server administration page and stop Glassfish server.

         localhost:4949 (Glassfish server administration page) click on 'server (Admin Server)' in the left pane,            then press the 'Stop' button.





Thursday, August 1, 2013

Tools tools tools...

Compiling a list of popular performance tools here...

No no... I am not talking about an electric saw... for now just limited to web performance tools.


  • Closure Compiler  - This is a java app that compiles from JavaScript to better JavaScript so that it can be downloaded faster and run faster. Web version can be found here
  • Add async attribute can be added to the script tag so that  javascript parsing can be put off so that the web page can be rendered faster. 

Monday, July 29, 2013

Looking for some good online training?

Here I would keep on updating some of the good online & free training materials.


Wednesday, July 10, 2013

What to do with Bots??? Web crawlers???


Getting considerable visits to you page? Well soon you will have more visits from Bots that from the real users. It is a phenomenon we have to live with. But then we can make a few changes to how we deal with them based on their characteristics.

1. Good Bots : Some companies have a different way of handling good bots. You need to take good care of them as they always lead you to more and more traffic which may lead to higher conversion. One way I have found in use is to redirect them to a different origin. Why we need to do this is because, it then becomes easier for NOC to distinguish between real issues and noise from the bots. You can always use robots.txt to define rules to see if you can get some of the major bots to behave well. You can even specify a time for crawl. What I have seen is that googlebot causes more then 75% of the requests from bots.

2. Bad Bots: Consider blocking them at Akamai WAF level or at the web server level based on the User-Agent value. You may even have to use you secondary fiirewall to add in additional rules.


Providing below some know bots.

  • *googlebot* 
  • *msnbot* 
  • *Yahoo!* 
  • *jobot*
  • *dotbot* 
  • *Pipes* 
  • *yacybot* 
  • *Python* 
  • *skJeeves* 
  • *AdsBot-Google* 
  • *YandexBot* 
  • *bingbot* 
  • *Ultraseek* 
  • *rogerbot* 
  • *youdaobot* 
  • *Mechanize* 
  • *Jakarta* 
  • *decobot* 
  • *curl* 
  • *psbot* 
  • *Slurp* 
  • *discobot* 
  • *MaxPointCrawler* 
  • *sogou* 
  • *ezooms* 
  • *RedCarpet* 
  • *bingshoppingbot* 
  • *FatBot* 
  • *spotbot* 

Also some times, bad bots will not have an easily identifiable User-Agent and so it may become necessary to block them by IP. For anonymous network routes likes Tors, it will be a different strategy. Will cover it some time in future. 


Monday, July 1, 2013

CloudTest Videos


You can find some good videos on SOASTA CloudTest here. Some of them could have been made better.

http://cloudlink.soasta.com/t5/CloudTest-Videos/bg-p/CloudTest_Videos

Tuesday, June 4, 2013

Performance Testing of MQ with Load Runner

Many a times we want to post some x messages/sec to an MQ using loadrunner and wonder if there is an easy way to do this. Over the net you will find a lot of articles but I will limit it to the basic steps to successfully do this.

The key for successfully doing this is to know your MQ. Rest is all easy. This post will cover the testing of Websphere MQ using web services license on a Windows Controller machine.

Steps:

  • Download and install the IBM Websphere MQ client on the Controller machine OR LoadGenerator. Click on Setup.exe and follow the instructions.























  • After installation, go to C:\Program Files (x86)\IBM\WebSphere MQ\java\bin provided you chose the default path for install. Edit JMSAdmin.config. The only changes I made in the file are given below for reference. 
    • INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    • PROVIDER_URL=file:/C:/JNDI


  • Now we need to provide all the queue level information you know and create a .scp file. I have created one called myfile.scp. The contents from the file I created is pasted below. Make sure that you check with development team and find the right port, channel name, queue name & queue manager name. Unless you get the right it will not work.
DEFINE QCF(QueueConnectionFactory) QMGR(MYOWNQUEUEMGR) tran(client) chan(PROVIDECHANNELNAME) host(Hostname or IP here) port(1414 or OTHER PORT)
DISPLAY QCF(QueueConnectionFactory)
DEFINE Q(MYOWNQUEUE) QUEUE(
MYOWNQUEUE) QMGR(MYOWNQUEUEMGR)
DISPLAY Q(
MYOWNQUEUE)
end

  •  Go to C:\Program Files (x86)\IBM\WebSphere MQ\java\bin & execute the command as shown below





This will create a .bindings file in the C:\JNDI directory. The verbose output of the above command is given below.

























  • Now we need to make the following run time settings change to our web services vugen script.
    • Change JNDI initial context factory to “com.sun.jndi.fscontext.RefFSContextFactory”
    • Change JNDI provider URL to “file:/C:/JNDI”
    • Change JMS connection factory to “QueueConnectionFactory” and click OK

















  • Now create a script and all should work. Check the queue depth and if the listeners are stopped, you should see an increase in depth. 

Sunday, April 14, 2013

Cron Schedule

Sometimes you just cannot avoid cron....I just had to write a schedule for some alerting of suspicious activity.

Providing link to a good article explaining how to schedule tasks using cron tab.


Thursday, April 11, 2013

Usability, Richness and Performance

Through this article I will be covering the Usability, Richness and Performance aspects of the mobile websites of some major retail companies in the US. I will limit myself to mobile version of the home page of these sites.

The sites I am planning to cover are taken from the -  Keynote Performance Index: Mobile Commerce (Retail) – US - Week Ending 7 April 2013 . These are arranged from the fastest to the slowest.

RankRetailerScore (out of 1,000)*Load Time (in seconds)Success Rate (percentage)
 1Barnes & Noble9504.4399.87
 2Grainger8424.2699.50
 3HSN8386.8499.75
 4Office Depot8314.7099.51
 5Toolfetch.com8122.8499.26
 6Amazon.com8006.7599.62
 7J.C. Penney7828.7099.75
 8PetSmart7588.3199.64
 9Target7458.6299.63
 10American Eagle Outfitters74111.2399.87
 11Sears6962.8998.88
 12Walgreens6946.5199.25
 13Dick's Sporting Goods69212.8399.87
 14Walmart.com6507.9699.25
 15Rakuten Shopping6497.5899.20

To be continued...

Monday, April 8, 2013

Browser Metrics - WebPagetest & Gomez & CatchPoint & others....


Most of us will be using some monitoring tool to measure the website performance. For example we have 2 sites to monitor and we want to compare how Site 1 did with respect to Site 2.

Here comes the world of monitoring tools. There are a lot of them and I am going to mention few of the key ones.
  • WebPageTest - This is a free version and quite popular
  • Keynote
  • Gomez
  • CatchPoint.

The above ones are also quite popular but they are not free and usually in use by large companies to have a record of their website performance, alert them in case of issues etc. I have been using CatchPoint lately and like the interface, support and features.

Now coming back to browser metrics. To keep it simple, I will start with a few and then keep on adding to this post. Will use the metrics provided by WebPageTest as this is widely used and free. See the example from a test I ran on WebPageTest.org. It is always a good practice to run at least 5 tests to find the data you are looking for. Some documentation can be found here webpagetest-metrics




  • OnLoad event - This is an event fired by the browser when it has loaded all the static contents. Onload waits on images too. The ready event occurs after the HTML document has been loaded, while the onload event occurs later, when all content (e.g. images) also has been loaded. 
  • Document complete is when the OnLoad event has been fired.
  • Fully Loaded - Usually after static content/main page has been loaded, javascript will cause to load some more (dynamic) content.. Suppose after dynamic content has been loaded there is no network activity for ~2 seconds, then it can be considered that the WebPage has been fully loaded. In calculating the fully loaded time, this 2 seconds is not included though. The measurement is till the point of the last network activity before this 2 seconds of no network activity. 


Sunday, February 24, 2013

Dance of Bots

Was doing some research to find some higher volume incidents reported by TrueSight. Know that these due to increase bot activity but sometimes, not able to or not worth taking action if these volumes can be managed by the site.

Please find the Dance of Bots for the time interval I was exploring from Splunk.


Wednesday, February 6, 2013

Recording of 64 bit applications in LoadRunner 11.5

As per Release notes for LoadRunner 11.5:

Recording of 64bit applications has been added to the existing support for 64bit operating systems. 64bit applications can usually be recognized when the ‘*32’ suffix is not displayed in the Windows Task Manager for their process. Replay is in 32bit.

When you start VuGen, it will be displayed in the Task Manager as VuGen.exe *32. This means Vugen is running as a 32 bit application. You can use either 32 bit or 64 bit versions of IE to record. You need to browse and provide the paths. Default shown is IE 32 bit. Paths provided below for your reference.


"C:\Program Files\Internet Explorer\iexplore.exe" - 64 bit
"C:\Program Files (x86)\Internet Explorer\iexplore.exe"- 32 bit

























Some other pointers on IE are given below: 

To start the 64-bit version of IE, click Start, and then click Internet Explorer (64-bit)

To determine the version of IE that you are using, click About Internet Explorer on the Help menu of Internet Explorer. If you are running the 64-bit version of Internet Explorer, the About Internet Explorer window includes a 64-bit descriptor label. The other one will not show a bit-level descriptor.

Tuesday, February 5, 2013

Avoiding Performance Testing in Production by mistake

Ever been in the situation that the tests you were running or supposed to be running in the Lab environment were actually running in production?

Why this could have happened?

  • The tester was careless
  • We are all prone to make mistakes.

All these happened because we were using a parameter file which were pointing to the production environment. In our case, we use the same scenario and modify the parameter file entries. One set of entries/URLs are of the Lab environment and the other set are of the Production environment. The file is supposed to contain the set for the right environment. 

I have a suggestion on how this can be prevented.
  • Have a check in your code to see if the URLs you are using from the parameter file are pointing to production
  • If so see if the current system date & time generated from the scripts matches an entry from another parameter file. I go for a time based counter with a two hour window. 
  • If the time and date falls with in the 2 hour window in file, the scenario can continue execution. Else provide error messages and exit the vUsers. 
  • So each time we need to run a test in Prod, we need to make sure that the parameter file has the right time and date for the execution to continue.

Also I would suggest setting up some alerting mechanism so that your monitoring team is aware of some tests  happening in production. We all want to inform them before starting our testing but do forget from time to time. I use Splunk regularly and have set up an alert in case the events per minute for the user-agent I am using is greater than a predetermined value. 

"I don't always test my code, but when I do, I prefer to do it in Production." :) 


Remove LoadRunner License

This article is valid for Windows 2008.

I have been trying to remove some extra licenses from the controller which got installed twice. It was strange that I could import the license again and again to keep on adding vUsers.

If you have tried support and yet not able to solve the issue, I would recommend looking at the below image and start from there. I am leaving the rest for you to find out.

Do so at your own risk.


How to clear WinINET cache and cookies from Fiddler

When trying to debug certain issues, it becomes necessary to clear the cache and cookies again and again. This being a repetitive task requires the use of short cut keys.

In case you are using Fiddler for your debugging and need to clear WinINET cache and cookies, it can be easily done using the QuickExec box. Execute the "nuke" command from the QuickExec box as shown in the image given below.



Thursday, January 31, 2013

Looking for a tool to help testing in IE?

Try www.modern.ie

  • You can test on newer and older versions of Internet Explorer
  • You can find common incompatibility problems
  • Have a broad range of virtual test tools to test from other platforms
  • Get some help in optimizing the tablet/touch experience of your website

LoadRunner Controller cannot create vusers

Seen this message and wondering what is wrong?

  • Check if the load generators are configured properly and available.
  • Close and reopen the scenario
  • Some times if the above 2 steps don't help, I would recommend you to create a new scenario and browse and add the scripts and try again. 

LoadRunner Clean Uninstall

Many a times we may have to do a uninstall and re install again.  Make sure that you follow the below steps.

  • Ensure that all LoadRunner Processes and Services are killed
  • In case you have some scripts, scenarios to be backup ed, do it
  • Run the uninstall program from LR or uninstall from control panel
  • Reboot the machine. If you are using remote desktop to connect to the loadrunner machines, make sure you choose reboot and not shutdown :p
  • Delete all Start Menu folders and all the LoadRunner folders that had got created as a part of the installation. 
  • Search for wlrun.* and vugen.* and remove any files found. Do this on all the folders which were created as a part of the previous install. May be you can delete them from temp folders also if any found
  • Do Start->Run->regedit
  • Delete the below keys if they are present
    • HKEY_CURRENT_USER ->Software -> Mercury Interactive -> LoadRunner
    • HKEY_CURRENT_USER\Software\C:

Wednesday, January 30, 2013

Data Execution Prevention - Is it applicable now?

It was advised with versions prior to LoadRunner 11.5 to disable DEP due to some limitations of Citrix protocol.

LR 11.50 does not mention this. But still if you want to proceed, select the option shown below. This is for Windows Server 2008.

Select System Properties->Advanced->Performance->Settings to get the below screen.


























Select Turn on DEP for essential Windows programs and services only and click Apply.

LoadRunner 11.50 General Limitations - User Account Control

There are many general limitations. I am just briefly introducing you to one I found today and had to spend a little time on.

To run LoadRunner on Windows 7 or 2008 Server, you must have

  • Admin Privileges
  • User Account Control must be disabled. 
To find out more on UAC on Windows Server 2008, 
  • Do Start->Run->secpol.msc
  • You must see the below screen and the highlighted one should be Disabled


Sunday, January 27, 2013

How to find the LoadRunner patches installed on your machine

  • Launch Controller or Analysis
  • Click help->About HP LoadRunner XXXX 
  • Click Details
  • This will bring a Web Page with all the details

How to find LoadRunner License details

  • After launching Controller (LoadRunner 11.5), click on LoadRunner License Utility

  • This will display the below window with the licenses you have available on this Host/Controller