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 booleanDEFAULT_CLEAR_CACHE_EACH_ITERpublic final static StringUSERNAMEpublic final static StringPASSWORDpublic transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description DNSCacheManager()
-
Method Summary
Modifier and Type Method Description Objectclone()Array<InetAddress>resolve(String host)Resolves address using system or custom DNS resolver voidtestIterationStart(LoopIterationEvent event)Clean DNS cache if appropriate check-box was selected voidclear()voidaddServer(String dnsServer)Add DNS Server CollectionPropertygetServers()voidaddHost(String dnsHost, String addresses)Add static host CollectionPropertygetHosts()booleanisClearEachIteration()Clean DNS cache each iteration voidsetClearEachIteration(boolean clear)Clean DNS cache each iteration booleanisCustomResolver()voidsetCustomResolver(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)
-
-
-
-