<?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; load runner</title>
	<atom:link href="http://blog.testsautomation.com/tag/load-runner/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>IP Spoofing with LoadRunner</title>
		<link>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/</link>
		<comments>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 18:40:24 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[load runner]]></category>
		<category><![CDATA[spoofing]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=242</guid>
		<description><![CDATA[As described here ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well. 
Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that [...]]]></description>
			<content:encoded><![CDATA[<p>As described <a href="http://www.securityfocus.com/infocus/1674">here</a> ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well. </p>
<p>Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that our results may be incorrect. To omit this issue we can change the IP address of each (e.g. HTTP) request that reaches the server and simulate load from multiple users not only on the application level but on the network level as well. In that case cache won’t affect performance tests. Fortunately folks from Mercury/HP implemented special function for IP spoofing in LoadRunner API.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">lr_enable_ip_spoofing<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&#8230;</div>
</li>
<li class="li1">
<div class="de1"><span class="me1">lr_disable_ip_spoofing</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
</div>
<p>To use it, first put your code between these to functions calls.<br />
Second (before connecting to load generator!!!) enable IP Spoofer option in LR Controller (Scenario > Enable IP Spoofer).</p>
<p>Let the hacking begin <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Tip:<br />
There is an option in Controller (in Expert mode) to choose between multiple IP addresses per process or per thread (Tools > Options).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/feed/</wfw:commentRss>
		<slash:comments>7</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>
	</channel>
</rss>
