<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Waldemar's blog &#187; performance</title>
	<atom:link href="http://blog.testsautomation.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.testsautomation.com</link>
	<description>Live fast, die old...</description>
	<lastBuildDate>Mon, 12 Jul 2010 20:51:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LoadRunner levels of integration with web pages</title>
		<link>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/</link>
		<comments>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 10:25:31 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=508</guid>
		<description><![CDATA[LoadRunner basically allows two approches for load testing your web application. Before going into details lets see how communication between user and web server looks like.

As you can see between user and web server there are mainly 2 layers: 

Layer 1 is where user interacts with the browser by e.g. clicking a button, selecting values [...]]]></description>
			<content:encoded><![CDATA[<p>LoadRunner basically allows two approches for load testing your web application. Before going into details lets see how communication between user and web server looks like.</p>
<p><img alt="" src="http://blog.testsautomation.com/wp-includes/images/user.png" class="alignnone" width="574" height="170" /></p>
<p>As you can see between user and web server there are mainly 2 layers: </p>
<ul>
<li><b>Layer 1</b> is where user interacts with the browser by e.g. clicking a button, selecting values from the list or submitting a form</li>
<li><b>Layer 2</b> is where browser communicates with web server which includes:
<ul>
<li>creating and sending HTTP requests to the web server based on user&#8217;s actions</li>
<li>receiving HTTP responses from the web server</li>
<li>rendering HTTP responses, forming an UI and displaying it to the user</li>
</ul>
</li>
</ul>
<p>Below I&#8217;m providing two scripts that do exactly the same thing but in slightly different way. The goal for each script is to search for a &#8220;linux&#8221; word using google search.</p>
<p>First, lets look at &#8220;Web (HTTP/HTML)&#8221; type of the script:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_url<span class="br0">&#40;</span><span class="st0">&quot;www.google.com&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;URL=http://www.google.com/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Resource=0&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;RecContentType=text/html&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Referer=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t1.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Mode=HTML&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_think_time<span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_url<span class="br0">&#40;</span><span class="st0">&quot;search&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;URL=http://www.google.co.uk/search?hl=en&amp;source=hp&amp;q=linux&amp;btnG=Google+Search&amp;meta=&amp;aq=f&amp;oq=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Resource=0&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;RecContentType=text/html&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Referer=http://www.google.co.uk/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t2.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Mode=HTML&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>What happens here?</p>
<ul>
<li>In line 3 we are entering google.com web site</li>
<li>In line 14 we are sending HTTP request that browser would generate after searching for value &#8220;linux&#8221;</li>
</ul>
<p>Now, lets look at &#8220;Web (Click and Script)&#8221; type of the script:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_browser<span class="br0">&#40;</span><span class="st0">&quot;www.google.com&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Navigate=http://www.google.com/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_edit_field<span class="br0">&#40;</span><span class="st0">&quot;q&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t1.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Type=text&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Name=q&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;SetValue=linux&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_button<span class="br0">&#40;</span><span class="st0">&quot;INPUT&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t2.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Type=submit&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Tag=INPUT&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;ID=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Value=Google Search&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;UserAction=Click&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<ul>
<li>In line 4 we are entering google.com web site</li>
<li>In line 10 we are typing value &#8220;linux&#8221; into the input field</li>
<li>In line 19 we are clicking &#8220;Google Search&#8221; button that will move us to the page with search results</li>
</ul>
<p>So what is the difference between these two scripts?</p>
<p>First script operates on much lover level comparing to second script. It deals with HTTP requests without taking care about what actions user actually performs. It doesn&#8217;t care how fast user&#8217;s browser renders and display the UI. It only checks how fast web server is able to response with correct message.</p>
<p>Second script operates only on UI level without taking care what happens underneath. Response time here includes not only time needed to send/receive HTTP traffic but also time needed to form/display UI to the user.</p>
<p>Basically second script approach is less error prone because you don&#8217;t have to deal with low level things like HTTP parameters. And You are replicating user&#8217;s actions in a natural way. </p>
<p>So if you need to choose, then I would recommend Web Click and Script type of the script. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t waste your time</title>
		<link>http://blog.testsautomation.com/2009/04/dont-waste-your-time/</link>
		<comments>http://blog.testsautomation.com/2009/04/dont-waste-your-time/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 21:57:34 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[load runner]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[wasted time]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=202</guid>
		<description><![CDATA[Waste time in Load Runner is a time spend on tasks that normal browser user wouldn&#8217;t perform like storing test results, performance monitoring, calculations, etc. Wasted time is measured by LR automatically but sometimes it is necessary to use it explicitly through lr_wasted_time() function . 
lr_wasted_times() removes time from all open transaction. If you want [...]]]></description>
			<content:encoded><![CDATA[<p>Waste time in Load Runner is a time spend on tasks that normal browser user wouldn&#8217;t perform like storing test results, performance monitoring, calculations, etc. Wasted time is measured by LR automatically but sometimes it is necessary to use it explicitly through lr_wasted_time() function . </p>
<p>lr_wasted_times() removes time from all open transaction. If you want to make some calculation and don&#8217;t count them into overall transaction time then you should use this function.</p>
<p>Small example</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; merc_timer_handle_t timer; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">long</span> i;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">double</span> wastedTime;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_start_transaction<span class="br0">&#40;</span><span class="st0">&quot;My_Transaction&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; timer = lr_start_timer<span class="br0">&#40;</span><span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>i = <span class="nu0">0</span>; i &lt; <span class="nu0">1000</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lr_message<span class="br0">&#40;</span><span class="st0">&quot;%d<span class="es0">\n</span>&quot;</span>, i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; wastedTime = lr_end_timer<span class="br0">&#40;</span>timer<span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; wastedTime*=<span class="nu0">1000</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_wasted_time<span class="br0">&#40;</span>wastedTime<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_end_transaction<span class="br0">&#40;</span><span class="st0">&quot;My_Transaction&quot;</span>, LR_AUTO<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_message<span class="br0">&#40;</span><span class="st0">&quot;Wasted %lf milliseconds&quot;</span>, wastedTime<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>On line 7 I&#8217;m starting one transaction. On line 8 I&#8217;m starting timer and stoping it at line 11. For loop between is used to generate my wasted time. After stopping the time, we need to subtract wasted time from open transaction by calling lr_wasted_time() on line 14. But before that on line 12 we need to change time units. lr_end_timer() returns time in seconds but lr_wasted_time() takes time in milliseconds. Thats why we need to multiply it by 1000. There is one more think. lr_wasted_time() is defined as </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw4">void</span> lr_wasted_time <span class="br0">&#40;</span><span class="kw4">long</span> wasteTime<span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
</div>
<p>If you use long type variable to measure wasted time you will always get rounded results (e.g. 1000, 2000, 3000). Instead it is better to use double type variable so at the end the results are more precise. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/04/dont-waste-your-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cleaning browser cache</title>
		<link>http://blog.testsautomation.com/2009/02/cleaning-browser-cache-loadrunner-web/</link>
		<comments>http://blog.testsautomation.com/2009/02/cleaning-browser-cache-loadrunner-web/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 14:54:02 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cleaning]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=27</guid>
		<description><![CDATA[Hello
As you know, browser can store some downloaded HTML/JPG/etc file from remote server on local hard drive so you can access it faster next time. This is called &#8220;cache&#8221;.
There is an option in LoadRunner VuGen to simulate browser cache behavior with your web performance testing. But how to use it and when? Here are my [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>As you know, browser can store some downloaded HTML/JPG/etc file from remote server on local hard drive so you can access it faster next time. This is called &#8220;cache&#8221;.</p>
<p>There is an option in LoadRunner VuGen to simulate browser cache behavior with your web performance testing. But how to use it and when? Here are my suggestions.</p>
<p><span style="color: #000000;"><strong>Don&#8217;t clean the cache</strong></span><br />
Your application is rather something internal used by (mostly) the same people in one company &#8211; In that case I suggest not to clean the cache because this will reflect users behavior in your tests. If you ask why? then ask yourself how often you clean your browser cache. Once a week? Once a month? Every login/logout? Are you getting the idea?</p>
<p>With such settings, your transaction performance graph would look like this:</p>
<p><img class="alignnone size-full wp-image-84" title="without_cache_cleaning1" src="http://blog.testsautomation.com/wp-content/uploads/2009/02/without_cache_cleaning1.png" alt="without_cache_cleaning1" width="564" height="307" /></p>
<p>After first iteration with cache enabled, transaction performance is much smaller. It&#8217;s because user gets most of the files from the cache.</p>
<p><span style="color: #000000;"><strong>Clean the cache:</strong></span><br />
Your application is accessible from the Internet, and your customers are basically everyones on the net &#8211; in that case I suggest to clean the cache because its more probable to have new person without cached content already.</p>
<p>This is example performance graph after tests with cleaning browser cache.</p>
<p><img class="alignnone size-full wp-image-82" title="with_cache_cleaning1" src="http://blog.testsautomation.com/wp-content/uploads/2009/02/with_cache_cleaning1.png" alt="with_cache_cleaning1" width="567" height="320" /></p>
<p>In each iteration, user has empty cache at the beginning so he need to get all the files from remote server.</p>
<p>Conclusion:</p>
<p>Only by cleaning/not cleaning the cache your transaction performance can vary significantly!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/02/cleaning-browser-cache-loadrunner-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
