Class DNSCacheManager
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.config.ConfigTestElement
org.apache.jmeter.protocol.http.control.DNSCacheManager
- All Implemented Interfaces:
Serializable
,Cloneable
,org.apache.http.conn.DnsResolver
,ConfigElement
,Searchable
,org.apache.jmeter.testelement.TestElement
,TestIterationListener
public class DNSCacheManager
extends ConfigTestElement
implements TestIterationListener, Serializable, org.apache.http.conn.DnsResolver
This config element provides ability to have flexible control over DNS
caching function. Depending on option from @see
DNSCachePanel
, either system or
custom resolver can be used. Custom resolver uses dnsjava library, and gives
ability to bypass both OS and JVM cache. It allows to use paradigm
"1 virtual user - 1 DNS cache" in performance tests.- Since:
- 2.12
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from class org.apache.jmeter.config.ConfigTestElement
PASSWORD, USERNAME
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add static hostvoid
Add DNS Servervoid
clear()
clone()
getHosts()
boolean
Clean DNS cache each iterationboolean
Resolves address using system or custom DNS resolvervoid
setClearEachIteration
(boolean clear) Clean DNS cache each iterationvoid
setCustomResolver
(boolean isCustomResolver) void
Each time through a Thread Group's test script, an iteration event is fired for each thread.Methods inherited from class org.apache.jmeter.config.ConfigTestElement
addConfigElement, addTestElement, expectsModification, getProps, getSchema
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
-
Field Details
-
DEFAULT_CLEAR_CACHE_EACH_ITER
public static final boolean DEFAULT_CLEAR_CACHE_EACH_ITER- See Also:
-
-
Constructor Details
-
DNSCacheManager
public DNSCacheManager()
-
-
Method Details
-
clone
- Specified by:
clone
in interfaceConfigElement
- Specified by:
clone
in interfaceorg.apache.jmeter.testelement.TestElement
- Overrides:
clone
in classAbstractTestElement
-
resolve
Resolves address using system or custom DNS resolver- Specified by:
resolve
in interfaceorg.apache.http.conn.DnsResolver
- Throws:
UnknownHostException
-
testIterationStart
Each time through a Thread Group's test script, an iteration event is fired for each thread. This will be after the test elements have been cloned, so in general the instance will not be the same as the ones the start/end methods call. Clean DNS cache if appropriate check-box was selected- Specified by:
testIterationStart
in interfaceTestIterationListener
- Parameters:
event
- the iteration event
-
clear
public void clear()- Specified by:
clear
in interfaceorg.apache.jmeter.testelement.TestElement
- Overrides:
clear
in classAbstractTestElement
-
addServer
Add DNS Server- Parameters:
dnsServer
- DNS Server
-
getServers
- Returns:
- DNS Servers
-
addHost
Add static host- Parameters:
dnsHost
- DNS hostaddresses
- Comma separated list of addresses
-
getHosts
-
isClearEachIteration
public boolean isClearEachIteration()Clean DNS cache each iteration- Returns:
- boolean
-
setClearEachIteration
public void setClearEachIteration(boolean clear) Clean DNS cache each iteration- Parameters:
clear
- flag whether DNS cache should be cleared on each iteration
-
isCustomResolver
public boolean isCustomResolver() -
setCustomResolver
public void setCustomResolver(boolean isCustomResolver)
-