On 26 February 2014 08:50, Dan Ledgard <[email protected]> wrote: > Thanks for the response unfortunately it is not what I was looking for, > maybe my question was not clear enough > > What I am looking to do is use an HTTP Request sampler with retrieve all > embedded resources enabled and setting a custom header. The value of this > custom header needs to be different for the webpage request and resource > requests, but can be the same for all resource requests. > > The APM is instrumenting the app under test so the header values need to be > different on the actual requests, post processing or manipulating JMeter > output files will not work unfortunately.
OK, in that case there are some other things you could try: - use a Pre-Processor to add the header to the intial request. I have not tried this, so I don't know if it will also affect subsequent samples. - disable the auto-download of embedded resources, and add separate samples for them. You can create the samples with the Recorder - or just look at what resources are downloaded currently. If the Pre-Processor does not work, and you want to use auto-download, then I think it will probably require code changes to the sampler. In your particiular case you could just skip the X-APM-Header for sub-samples. That would probably be the simplest, but least flexible. A more general solution would require either flagging headers as being for the initial sample only. Or establishing a way to intercept the embedded processing sequence. At present the Pre- and Post- Processors apply to the main sample only. Assertions can apply to sub-samples, but these operate on the sample result collection, so the same approach won't work. But if a processor could be invoked between the main and subsamples, this would allow adjustment of headers etc. > e.g. > GET /news/ HTTP/1.1 > X-APM-Header: News Page > > GET /resources/style/main.css HTTP/1.1 > X-APM-Header: News resources > > GET /resources/script/widjets.js HTTP/1.1 > X-APM-Header: News resources > > > thanks > > Dan > > > On 26 February 2014 02:41, sebb <[email protected]> wrote: > >> On 24 February 2014 14:32, Dan Ledgard <[email protected]> wrote: >> > Hi >> > >> > I am using JMeter for loading a system under test that is monitored by an >> > APM solution. This uses an HTTP header to identify webpages or web >> service >> > requests. >> > >> > I currently have an HTTP Request sampler with retrieve all embedded >> > resources enabled and a child >> > HTTP Header Manager defining the header. Unfortunately this results in >> the >> > main request and all embedded resource requests having this header, with >> > the APM then aggregating response times across all of these. >> > >> > Ideally I am looking for the main requests to be aggregated separately to >> > the embedded resources and so would like to set the header to a different >> > value. >> > >> > I cannot see a way to do this with the current components, does anyone >> know >> > the best way to approach this. Would I need to look at extending the HTTP >> > Request sampler? >> >> You can save subsample details when using XML format. >> It should then be possible to extract the information that you want. >> >> It may also be possible to write a PostProcessor to massage the >> results to remove the headers that are not wanted. >> >> > thanks >> > >> > Dan >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
