150 likes | 180 Views
DFS JMeter Architecture. Why Choose JMeter for Performance Testing?. load and performance test many different server types: Web - HTTP, HTTPS SOAP Database via JDBC LDAP JMS Mail - POP3 Complete portability and 100% Java purity .
E N D
Why Choose JMeter for Performance Testing? • load and performance test many different server types: • Web - HTTP, HTTPS • SOAP • Database via JDBC • LDAP • JMS • Mail - POP3 • Complete portability and 100% Java purity . • Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. • Caching and offline analysis/replaying of test results. • Highly Extensible: • Pluggable Samplers allow unlimited testing capabilities. • Several load statistics may be choosen with pluggable timers . • Data analysis and visualization plugins allow great extendibility as well as personalization. • Functions can be used to provide dynamic input to a test or provide data manipulation. • Scriptable Samplers (BeanShell is fully supported; and there is a sampler which supports BSF-compatible languages) • Active Community and Community Authored Extensions
JMeter Extensions • Stats Agg Visualizer • Mashup JMeter and JFreeChart for real time results visualization. • JChav • Another JMeter/JFreeChart mashup designed analyze and report on JMeter results in batch.
JMeter Test Plans • JMeter Test Plans • Stored as XML files with “.jmx” extensions. • Tightly coupled to Samplers • Highly configurable
JMeter Samplers • Samplers are designed to configure and drive custom test code. • JMeter ships with several samplers “out of the box” • Extensible with user written samplers
Building the JMeter Project • Checkout the Perforce project • Install Ant 1.7 • Configure JDK 1.5.x • Invoke the following targets with ant: ant setup install jmeter
DFS Performance Test Kit Code Layout Project Directory Layout • DFSPerformanceTestKit Project Directory • DFSPerformanceLibrary DFS Specific Code • emc-dfs-sdk-6.5 DFS SDK • JMeterSampler JMeter specific module • TestPlans Location to store JMeter test plans • ThirdPartyTools Base JMeter and JChav distributions. • Checked into perforce at: • //Depot/Playground/Pleasanton/ottatm/DFSPerformanc/TestKit
DFSPerformanceLibrary Architecture • Sampler Interface • Loosely inspired by JUnit • sampleSetup() is intended for self contained samplers • Context is intended to share DFS or DFC context between samplers public interface Sampler { public void sampleSetup() throws ServiceException; public void sample() throws ServiceException; public void releaseContext() throws ServiceException; public SamplerContext getContext() ; public Properties getDefaultProperties(); public interface MutableProperties { public Properties getProperties(); public void setProperties(Properties props); }
Operation, Transport, SamplerContext • Operation • “enum” that contains static information about each sampler type. • Transport • “enum” that represents each of the 4 transport types implemented in the code base • remote • local • DFC • remoteUCF • SamplerContext • Base class that DFSSamplerContext and DFCsamplerContext are derrived from. • Getters for attributes passed into the constructor. • transport • username • password • contentSize • batchSize • Batch size and content size are immutable for the life of the context.
Sampler Packaging • Empty container with two static inner classes public class CheckinObject { static class DFS extends AbstractSampler { public DFS(DFSSamplerContext context, Properties properties) { super(context, properties); } public void sampleSetup() throws ServiceException { } public void sample() throws ServiceException { } } static class DFC extends AbstractSampler { public DFS(DFCSamplerContext context, Properties properties) { super(context, properties); } public void sampleSetup() throws ServiceException { } public void sample() throws ServiceException { } } }
Builders • Builder pattern used in place of constructors for Context and Sampler objects. • Builders shield clients from the arcane type based differences at construction time. • ContextBuilder • Understands the differences based upon context type e.g. dfc, remote …. • SamplerBuilder • Context (form Context Builder) is an argument • Dynamically loads and instantiates the class based upon the Operation type. • Tightly coupled with the Operation class.
Batch Testing • JMeter can be run “dark” • Good pattern for test automation