Using ArcGIS Pro to Generate Test Data for Use with Map Services (Beginner/Intermediate)

4066
2
07-29-2021 11:17 AM
AaronLopez
Esri Contributor
5 2 4,066

What is Test Data?

Simply put, test data is used to drive a performance or load test by requesting different areas of interest from an ArcGIS Enterprise map service. This spatial parts of the data usually takes the form of a points or bounding boxes (bboxes) and is typically stored a plain text file or in some cases a database.

Previous Community Articles on Load Testing ArcGIS Enterprise with Apache JMeter focused on strategies for building test logic and running the test. The sample projects provided on these blogs included test data in the form of plain text comma separated value (CSV) files that plugged right into the requests. These CSV files contained items like bounding boxes and a corresponding spatial reference to provide the HTTP requests in the test with parameter information. With each iteration of test, the next line of data is read in which is then populated into the request.

test_data_example.png

 For demonstration purposes, this test data worked well for requesting different map scales against services like SampleWorldCities and NaturalEarth. However, those sample test datasets are limited for use with other map services as the pre-generated bounding boxes were created to only ask for areas of interest around the world at a high level. If your organization is working with data at the state, county or city level, you'll want to have test data that focuses on those areas to maximize load test value. In other others, you want test data at a larger map scale and test data cover a specific area of interest.

Generating such data that is specific to your services or your spatial data becomes a critical piece of the process for making a good load test. While composing a few geometries by hand for a simple test is certainly doable, the request signatures are quickly repeated resulting in scalability patterns that are skewed and not realistic. A better test is one that utilizes a large amount of random geometries to push the map service and hardware resource more effectively.

Tools for Creating Custom Load Data

Thankfully, there is a set of recently released testing tools for ArcGIS Pro on GitHub that makes the task  of data generation extraordinarily easy. 

One of my favorite tools in the group is "Generate Bounding Boxes" which can quickly generate bounding boxes by the either the map's current extent or a selected polygon. Having the ability to passing in a specific polygon is a very powerful feature as the geometries that are created can be filtered to just your area of interest (e.g. Country, State, County or City). The generated data can be validated visually (via separate feature classes that are created) and plugged right into a JMeter Test Plan (via CSV files that are also created). Again, very easy...very powerful.

Creating Custom Test Data

Making the Tools Available from ArcGIS Pro

Once the load-testing-tools project has been downloaded to your machine, place the folder in a directory that is accessible or made accessible by ArcGIS Pro.

For example:

  • Place the load-testing-tools folder in C:\Users\[username]\Documents\ArcGIS
  • Use the Add Folder Connection from Catalog in ArcGIS Pro to list the contents of this directory:

arcgispro_catalog_loadtestingtools.png

Using A Polygon to Outline the Area of Interest

In this ArcGIS Pro project, a polygon feature class (U.S. State of Indiana in pink) has been added to the Map to define a boundary around the area where the bounding boxes for the requests in the test will be generated.

  • The Projected Coordinate System of the Indiana State feature class is: WGS 1984 Web Mercator (auxiliary sphere)
    • Its WKID is: 3857
  • For a point of reference, the default Basemap (World Topographic Map) is left in the map
    • The Projected Coordinate System of the Basemap is also: WGS 1984 Web Mercator (auxiliary sphere)

arcgispro_basemap_statepolygon.png

Generate Bounding Boxes Tool Inputs

You can launch the Generate Bounding Boxes tool, by navigating the load-testing-tools folder from the ArcGIS Pro Catalog screen. Expand the Load Testing Tools.tbx and double-click on Generate Bounding Boxes. The Geoprocessing screen should populate and look similar to the following:

arcgispro_generateboundingboxes.png

One of the convenient features about the Generate Bounding Boxes tool is that technically ready to go just by clicking Run! With the default options, it will randomly generate bounding boxes using the current extent of the ArcGIS Pro map. 

Note: The default map scales of the Generate Bounding Boxes tool are similar to those of ArcGIS Online but for brevity, only every other scale is listed. You additional map scales are needed, they can be manually added from within the tool.

While this make the data generation really easy, in this example, we are interested in generating boxes inside a particular polygon (State of Indiana). We also want to be very specific on the map scales our test will be using, so we'll want to remove some scales and add others from the tool's interface.

From the Generate Bounding Boxes tool:

  • Click the red X in front of 73957191, 18489298, 4622324, 1155581, 288895, 282, 70 to remove these map scales

arcgispro_remove_small_mapscales.png

  • From the empty text box under the Scale column, Add 36112 and use 100 for the Number of Records column
  • From the empty text box under the Scale column, Add 9028 and use 1000 for the Number of Records column
  • From the empty text box under the Scale column, Add 2257 and use 3000 for the Number of Records column
  • Increase the Number of Records for 4514 to 1000 records
  • Increase the Number of Records for 1128 to 3000 records

arcgispro_adjusted_mapscales.png

  •  Click the drop down under Polygon Layer and select the feature class of interest with in the Map, in this case, Indiana

arcgispro_selected_polygon.png

  •  Expand Output Options
    • Note the location of the bounding boxes csv file
      • Separate csv files per map scale will also be created at this location
    • Select "Output Separate Feature Class Per Scale" option

arcgispro_outputoptions.png

  • After the customization, the Generate Bounding Boxes tool input should look like the following ([username] would reflect your Windows username):

arcgispro_generateboundingboxes_custom.png

  • Click Run
    • Tool execution may take a few moments
    • The Table of Contents screen will start to populate by adding feature classes to the Map (one per scale)

Visualizing the Generated Data from the Individual Feature Classes

  • Once complete, the output within ArcGIS Pro should look similar to the following:

arcgispro_generateboundingboxes_generatedoutput.png

  • The individual feature class make quality checking a breeze as its easy to see the areas of interest that the test will be making from the generated data

Note: Some of the generated bounding boxes may have portions of the their geometry that fall outside the polygon of interest. This is okay.

  • Thanks to the visualization of the data, it is also easy to see why fewer bounding boxes were created for smaller map scales like 1:72,224 and 1:36,112
  • Similarly, this is why more bounding boxes were created for larger map scales like 1:2,257 and 1:1,128

arcgispro_generateboundingboxes_generatedoutput_zoom.png

 Note: Depending on your data and it density at the larger scales, it could be advantageous to generate more than 3000 bounding boxes (per scale) in order to "cover more ground". Keep in mind that some load test frameworks may read CSV data into memory and creating extremely large datasets may require more memory from the test client.

Visualizing the Generated Data from the Individual CSV Files

  • Using the file system explorer, navigate to the ArcGIS Pro project used for generating the data:
    • C:\Users\[username]\Documents\ArcGIS\Projects\MyProject1
  • The folder contents should look similar to the following:

filesystem_generatedoutput.png

  • Opening the contents of bounding_boxes_2257.csv should resemble the following:

generated_test_data_example.png

  • This data will work with most load testing tools that allow the parameterization of HTTP requests from CSV files

Note: The feature class to use as a Polygon Layer for spatial filtering can utilize a Projected Coordinate Systems other than WGS 1984 Web Mercator (auxiliary sphere). However, the generated CSV data will still be projected into bounding boxes that have a WKID of 3857.

Using the Generated Data in an Apache JMeter Test Plan

With a procedure for generating spatially customized data, you can take the CSV files and import them into an Apache JMeter Test Plan to use in a load test.

The previous testing Articles:

Provided Apache JMeter sample tests that would make good templates to use with your new data and against your map services.

CSV Data Set Config

Using the CSV Data Set Config element in JMeter, the new generated test data can be referenced from its path on the file system.

  • The Filename path value refers to the location of the CSV file on the disk
    • C:/JMeter Tests/naturalearth1/datasets/bounding_boxes_288895.csv
      • Sample test projects from previous Articles used variables for the path
        • ${ProjectFolder}/datasets/bounding_boxes_288895.csv
  • The Variable Names denotes the column headers in the CSV file
    • bbox,width,height,mapUnits,sr,scale would then become bbox_288895,width_288895,height_288895,mapUnits_288895,sr_288895,scale_288895 as the test may be using other map scales where just "bbox" would be ambiguous

generated_test_data_csvdatasetconfig.png

The HTTP Request elements pointing to your map service can then be adjusted to utilize variables such as ${bbox_288895} that reference your generated test data.

 

 

Apache JMeter released under the Apache License 2.0. Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are trademarks of the Apache Software Foundation.

2 Comments
RDSpire
New Contributor

I wanted to thank you for putting out this series of articles. Our GIS department has no performance or load testing setup and I have routinely asked about it. With these articles, I've learned a lot about how to get started on setting up our own.

 

Are there more planned to be released? I'd be very interested in an overview of interpreting load results as well as more detailed looks at how to test something like a web map or web app published from Enterprise.

AaronLopez
Esri Contributor

Hello @RDSpire,

I am very happy to hear that you found these articles are useful.
Yes...our team definitely have more planned, including one that covers our take for interpreting load tests results.
Your suggested topic, "How to test a web application published from ArcGIS Enterprise" also sounds like good subject to socialize on Community.

Thank you for your feedback!
Aaron