Class DNSCacheManager
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.http.conn.DnsResolver
,org.apache.jmeter.config.ConfigElement
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.testelement.TestElement
,org.apache.jmeter.testelement.TestIterationListener
public class DNSCacheManager extends ConfigTestElement implements TestIterationListener, Serializable, DnsResolver
This config element provides ability to have flexible control over DNS caching function. Depending on option from @see org.apache.jmeter.protocol.http.gui.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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static boolean
DEFAULT_CLEAR_CACHE_EACH_ITER
public final static String
USERNAME
public final static String
PASSWORD
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description DNSCacheManager()
-
Method Summary
Modifier and Type Method Description Object
clone()
Array<InetAddress>
resolve(String host)
Resolves address using system or custom DNS resolver void
testIterationStart(LoopIterationEvent event)
Clean DNS cache if appropriate check-box was selected void
clear()
void
addServer(String dnsServer)
Add DNS Server CollectionProperty
getServers()
void
addHost(String dnsHost, String addresses)
Add static host CollectionProperty
getHosts()
boolean
isClearEachIteration()
Clean DNS cache each iteration void
setClearEachIteration(boolean clear)
Clean DNS cache each iteration boolean
isCustomResolver()
void
setCustomResolver(boolean isCustomResolver)
-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
canRemove, clearTestElementChildren, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Methods inherited from class org.apache.jmeter.config.ConfigTestElement
addConfigElement, addTestElement, expectsModification, getProps, getSchema
-
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
resolve
Array<InetAddress> resolve(String host)
Resolves address using system or custom DNS resolver
-
testIterationStart
void testIterationStart(LoopIterationEvent event)
Clean DNS cache if appropriate check-box was selected
-
clear
void clear()
-
getServers
CollectionProperty getServers()
-
addHost
void addHost(String dnsHost, String addresses)
Add static host
- Parameters:
dnsHost
- DNS hostaddresses
- Comma separated list of addresses
-
getHosts
CollectionProperty getHosts()
-
isClearEachIteration
boolean isClearEachIteration()
Clean DNS cache each iteration
-
setClearEachIteration
void setClearEachIteration(boolean clear)
Clean DNS cache each iteration
- Parameters:
clear
- flag whether DNS cache should be cleared on each iteration
-
isCustomResolver
boolean isCustomResolver()
-
setCustomResolver
void setCustomResolver(boolean isCustomResolver)
-
-
-
-