<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generating random extents using JMETER testing... in ArcGIS Image Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275143#M440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may be due to Javascript engine performance problems. It is recommended to use JSR223 Sampler and Groovy language for scripting as Javascript/Beanshell have well-known performance constraints as their "Scriptable" interface implementations don't implement compilable and groovy does. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So groovy code can be almost as fast as native Java code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://blazemeter.com/blog/beanshell-vs-jsr223-vs-java-jmeter-scripting-its-performance"&gt;JMeter Extensions Performance Comparison&lt;/A&gt;&lt;SPAN&gt; for details.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Feb 2014 10:47:43 GMT</pubDate>
    <dc:creator>DmitriT</dc:creator>
    <dc:date>2014-02-23T10:47:43Z</dc:date>
    <item>
      <title>Generating random extents using JMETER testing...</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275141#M438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm doing some performance testing on a ImageService through AGS WMS and I'm trying to generate random extents.&amp;nbsp; I've tried a very overly simplistic javascript to do this based on the max extent, however the images coming back get scewed, etc.&amp;nbsp; This is not an ArcServer or ImageServer problem, but rather that my random number generator may be giving me back unrealistic extents. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better method if, given a max extent, projection, image length, and image width, of generating USABLE extent values?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My current code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;/**
 * Generates a random number that falls between a max and min value.
 * @param minValue The minimum value.
 * @param maxValue The maximum value.
 * @param precision The floating-point precision value.
 * @return A random float number between the min and max value.
 */
function randomFloatBetween(minValue,maxValue,precision){
 if(typeof(precision) == 'undefined'){
&amp;nbsp; precision = 2;
 }
 return parseFloat(Math.min(minValue + (Math.random() * (maxValue - minValue)),maxValue).toFixed(precision));
}

//set the maximum extent.
var ymin = parseFloat("43.893368");
var xmin = parseFloat("-76.201033");
var ymax = parseFloat("47.785260");
var xmax = parseFloat("-69.957141");

//generate 2 random x points.
var xvalue = randomFloatBetween(xmin, xmax, 6);
var xvalue2 = randomFloatBetween(xmin, xmax, 6);

//generate 2 random y points.
var yvalue = randomFloatBetween(ymin, ymax, 6);
var yvalue2 = randomFloatBetween(ymin, ymax, 6);

//set the NEW xmin, xmax, ymin, ymax values.
var minX = 0;
var minY = 0;
var maxX = 0;
var maxY = 0;
if(xvalue &amp;gt;= xvalue2) {
 maxX = xvalue;
 minX = xvalue2;
} else {
 maxX = xvalue2;
 minX = xvalue;
}
if(yvalue &amp;gt;= yvalue2) {
 maxY = yvalue;
 minY = yvalue2;
} else {
 maxY = yvalue2;
 minY = yvalue;
}

vars.put('bbox', minY+','+minX+','+maxY+','+maxX);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bill&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 18:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275141#M438</guid>
      <dc:creator>BillZborowski1</dc:creator>
      <dc:date>2010-08-30T18:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generating random extents using JMETER testing...</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275142#M439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Following Python based code may help you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It takes as input the extents and pixelSize range values and Cols &amp;amp; Rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to covnert easily. Ensure you define in the request the Width (Cols) and Height (rows).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Aug 2010 15:36:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275142#M439</guid>
      <dc:creator>PeterBecker</dc:creator>
      <dc:date>2010-08-31T15:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Generating random extents using JMETER testing...</title>
      <link>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275143#M440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may be due to Javascript engine performance problems. It is recommended to use JSR223 Sampler and Groovy language for scripting as Javascript/Beanshell have well-known performance constraints as their "Scriptable" interface implementations don't implement compilable and groovy does. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So groovy code can be almost as fast as native Java code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://blazemeter.com/blog/beanshell-vs-jsr223-vs-java-jmeter-scripting-its-performance"&gt;JMeter Extensions Performance Comparison&lt;/A&gt;&lt;SPAN&gt; for details.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Feb 2014 10:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-image-server-questions/generating-random-extents-using-jmeter-testing/m-p/275143#M440</guid>
      <dc:creator>DmitriT</dc:creator>
      <dc:date>2014-02-23T10:47:43Z</dc:date>
    </item>
  </channel>
</rss>

