JM Embedded

Load embedded resources (or not)

In my day-to-day work I have to run several different configurations of tests to answer different questions. For example, sometimes I load a site with the pure html code only, to check the back end database performance. And sometimes I want to also load up all the internally hosted static content, to get a wider feel for how our site is working from across our internal estate. I do also cover the complete loading of the site but at that point I tend to switch tools, to webpagetest, to monitor the full front end load profile.

On this page I'll present my method for configuring a test run from within a Jenkins build to either run with or without embedded statics included. I'll also show how you can confirm after the event that everything worked as expected.

Jenkins build configuration
JMeter test runs on this site are controlled via a Jenkins build. To set environment variables we can use the method
here. Thus we can either set:

project="my-project" ./ duration=3600 statics=do_not_load


project="my-projectl" ./ duration=3600 statics=http

Script settings
The script uses the methods described
elsewhere on this site to read in the value fo ${statics} and then uses the embedded option on each request made:


So, embedded resource must match whatever ${statics} is set to at the start of the URL followed by any pattern containing the webhost (which is set elsewhere). This ensures we get embedded resources only from our own servers and if we set ${statics} to something like 'do_not_load', then no embedded resources will be found and thus loaded. Turning this option on and off gives a GUI mode Jmeter graph showing response codes per second as follows:


In GUI mode this is fine and in fact I would use Fiddler just to check that I am doing what I expect. However when I run in non-gui mode, from multiple cloud injectors, I want some way of easily telling if everything is working without having to go off and find system log files and track down all the requests. I want a quick and dirty confirmation, as described below.

Final results analysis
Lots of data is collated during our Jmeter test runs. There doesn't seem to be an easy way of getting a full request log, including all the embedded resources called (and perhaps further resources called from them). But we can get number of bytes per request from our standard logs and this is what we can work with for confirmation of our setup above.

So, turning statics on and off as above gives a nice GUI mode graph AND it gives a nice final results graph if we look at the bytes column of our assertions files:


So you can see how we know whether or not statics were downloaded during any particular test run. And for my CI tests I have noted the average bytes counts for one particular assertion file with statics on and off:

520k WITH statics
61k without statics

So if I am concerned about my data (for eaxmple I saw some runs which were quicker with statics than certain runs without statics!), I can confirm exactly what the test is doing, at least in terms of bytes coming down the line.

So this becomes a working solution for CI use. If required, that average bytes count could be calculated with a bash script and reported back as a pass/fail criteria, or graphed alongside 95th percentiles etc.

[Home] [About (CV)] [Contact Us] [JMeter Cloud] [JM Highlights] [JM Overview] [JM Control] [JM Inject] [JM Threads] [JM Results] [JM Assertions] [JM TPS] [JM Metrics] [JM Runtime] [JM Collation] [JM Logs] [JM 95th] [JM 95th v2] [JM Jenkins] [JM Corporate] [JM Scripts] [JM Variables] [JM Embedded] [JM Hosts] [JM Running] [JM Example] [JM Versions] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash] [LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH] [Bash methods] [Jenkins V2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts] [JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]

In the Cartesian Elements Ltd group of companies