jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <Antony.Bowes...@williamhill.com.au>
Subject HTTP requests and HeaderManager
Date Fri, 23 Dec 2016 03:44:56 GMT
Could be way off target here, as I'm a bit of a newbie.

I have a custom java sampler that uses a HeaderManager to manage headers in multiple requests.
My sampler makes a number of http requests in a single sample to form part of a dynamic 'transaction'
and this means that different requests may need different headers, e.g. some could be GET,
some POST, some require CSRF headers etc.

I'm using an HTTPSamplerBase implementation and it appears there's no distinction between
a default header and a request header that just applies to the request to be sent, could be
wrong, but I can't see any way to separate the two in the API.

My solution is to manage default and request headers is a wrapper class that will remove headers
after the request is made, so they do not pollute subsequent requests.

However, from my basic reading of the code, the header manager is using an ArrayList to store
headers and to remove a header, it has to iterate that list.

Is there any reason why it would not be more sensible to use a LinkedHashSet. Slightly additional
overhead in storage, but much faster in removing elements.

Cheers


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message