├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── netty-framework-api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── netflix │ └── zuul │ └── proxy │ └── framework │ └── api │ ├── FrameworkHttpRequest.java │ ├── FrameworkHttpResponse.java │ ├── HttpRequestHandler.java │ ├── HttpRequestHandlerFactory.java │ ├── HttpResponseHandler.java │ ├── HttpResponseHandlerFactory.java │ ├── Interrupts.java │ └── Route.java ├── netty-framework-plugins ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── netflix │ └── zuul │ └── proxy │ └── framework │ └── plugins │ ├── GlobalRedirectRequestHandler.java │ ├── GlobalRewriteRequestHandler.java │ ├── LoggingRequestHandler.java │ └── LoggingResponseHandler.java ├── netty-mock-server ├── burner.jmx ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── netflix │ └── zuul │ └── proxy │ └── MockEndpoint.java ├── netty-server ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── netflix │ │ │ └── zuul │ │ │ └── proxy │ │ │ ├── CommonHttpPipeline.java │ │ │ ├── HttpOutboundPipeline.java │ │ │ ├── HttpServer.java │ │ │ ├── IllegalRouteException.java │ │ │ ├── ProxyServer.java │ │ │ ├── core │ │ │ ├── CommonsConnectionPool.java │ │ │ ├── Connection.java │ │ │ ├── ConnectionPool.java │ │ │ └── InterruptsImpl.java │ │ │ └── handler │ │ │ ├── ClientTimingHandler.java │ │ │ ├── ExceptionSurfacerHandler.java │ │ │ ├── HandlerFactory.java │ │ │ ├── HttpAppResolvingHandler.java │ │ │ ├── HttpKeepAliveHandler.java │ │ │ ├── HttpProxyHandler.java │ │ │ ├── HttpRequestFrameworkAdapter.java │ │ │ ├── HttpRequestFrameworkHandler.java │ │ │ ├── HttpResponseFrameworkAdapter.java │ │ │ ├── HttpResponseFrameworkHandler.java │ │ │ ├── IdleChannelWatchdog.java │ │ │ ├── ServerTimingHandler.java │ │ │ └── SocketSuspensionHandler.java │ └── resources │ │ └── logback.xml │ └── test │ └── java │ └── com │ └── netflix │ └── zuul │ └── proxy │ ├── HttpServerTest.java │ └── ProxyServerTest.java ├── performance-tests ├── images │ ├── cpu.png │ ├── netty │ │ ├── cpu.png │ │ ├── cswitch.png │ │ ├── gc.png │ │ ├── memfree.png │ │ ├── network.png │ │ └── runq.png │ ├── network.png │ ├── qlen.png │ ├── tomcat │ │ ├── cpu.png │ │ ├── cswitch.png │ │ ├── gc.png │ │ ├── memfree.png │ │ ├── network.png │ │ └── runq.png │ ├── tp50.png │ ├── tp75.png │ └── tps.png ├── performance-dedicated.md └── performance-ec2.md ├── pom.xml ├── zuul-core ├── pom.xml └── src │ ├── main │ ├── filters-archive │ │ ├── post │ │ │ ├── SendResponse.groovy │ │ │ └── Stats.groovy │ │ ├── pre │ │ │ ├── Debug.groovy │ │ │ ├── DebugRequest.groovy │ │ │ └── PreDecoration.groovy │ │ └── route │ │ │ └── SimpleHostRequest.groovy │ ├── filters │ │ └── pre │ │ │ └── PreDecoration.groovy │ └── java │ │ └── com │ │ └── netflix │ │ └── zuul │ │ └── netty │ │ ├── DynamicCodeCompiler.java │ │ ├── debug │ │ └── Debug.java │ │ ├── filter │ │ ├── AbstractZuulPostFilter.java │ │ ├── AbstractZuulPreFilter.java │ │ ├── FiltersChangeListener.java │ │ ├── FiltersChangeNotifier.java │ │ ├── FiltersListener.java │ │ ├── Ordered.java │ │ ├── ZuulFilter.java │ │ ├── ZuulFiltersLoader.java │ │ ├── ZuulPostFilter.java │ │ └── ZuulPreFilter.java │ │ ├── groovy │ │ ├── GroovyCompiler.java │ │ └── GroovyFileFilter.java │ │ └── util │ │ └── Announcer.java │ └── test │ └── java │ └── com │ └── netflix │ └── zuul │ └── netty │ ├── ZuulRunnerTest.java │ ├── ZuulServerTest.java │ └── filter │ └── ZuulFiltersLoaderTest.java └── zuul-perf-tests ├── build.xml ├── pom.xml ├── src └── test │ ├── java │ └── EndToEndTest.java │ ├── jmeter │ └── burner.jmx │ └── resources │ ├── filters │ └── pre │ │ └── PreDecoration.groovy │ └── logback.xml └── tools └── apache-jmeter-2.9 ├── LICENSE ├── NOTICE ├── README ├── bin ├── ApacheJMeter.jar ├── BeanShellAssertion.bshrc ├── BeanShellFunction.bshrc ├── BeanShellListeners.bshrc ├── BeanShellSampler.bshrc ├── examples │ ├── CSVSample.jmx │ ├── CSVSample_actions.csv │ ├── CSVSample_user.csv │ ├── PerformanceTestPlanMemoryThread.jmx │ └── jsp │ │ └── memory.jsp ├── hc.parameters ├── heapdump.cmd ├── heapdump.sh ├── httpclient.parameters ├── jmeter ├── jmeter-n-r.cmd ├── jmeter-n.cmd ├── jmeter-report ├── jmeter-report.bat ├── jmeter-server ├── jmeter-server.bat ├── jmeter-t.cmd ├── jmeter.bat ├── jmeter.properties ├── jmeter.sh ├── jmeterw.cmd ├── log4j.conf ├── logkit.xml ├── mirror-server.cmd ├── mirror-server.sh ├── proxyserver.jks ├── saveservice.properties ├── shutdown.cmd ├── shutdown.sh ├── stoptest.cmd ├── stoptest.sh ├── system.properties ├── upgrade.properties └── user.properties ├── extras ├── ConvertHTTPSampler.txt ├── Test.jmx ├── addons.txt ├── addons.xml ├── ant-jmeter-1.1.1.jar ├── build.xml ├── collapse.png ├── convertjmx.fdl ├── execcode.bsh ├── expand.png ├── jmeter-results-detail-report.xsl ├── jmeter-results-detail-report_21.xsl ├── jmeter-results-report.xsl ├── jmeter-results-report_21.xsl ├── jmeter.fb ├── printvars.bsh ├── proxycert.cmd ├── proxycert.sh ├── remote.bsh ├── schematic.cmd ├── schematic.xml ├── schematic.xsl └── startup.bsh ├── lib ├── activation-1.1.1.jar ├── avalon-framework-4.1.4.jar ├── bsf-2.4.0.jar ├── bsh-2.0b5.jar ├── bshclient.jar ├── commons-codec-1.6.jar ├── commons-collections-3.2.1.jar ├── commons-httpclient-3.1.jar ├── commons-io-2.2.jar ├── commons-jexl-1.1.jar ├── commons-jexl-2.1.1.jar ├── commons-lang-2.6.jar ├── commons-lang3-3.1.jar ├── commons-logging-1.1.1.jar ├── commons-net-3.1.jar ├── excalibur-datasource-1.1.1.jar ├── excalibur-instrument-1.0.jar ├── excalibur-logger-1.1.jar ├── excalibur-pool-1.2.jar ├── ext │ ├── ApacheJMeter_components.jar │ ├── ApacheJMeter_core.jar │ ├── ApacheJMeter_ftp.jar │ ├── ApacheJMeter_functions.jar │ ├── ApacheJMeter_http.jar │ ├── ApacheJMeter_java.jar │ ├── ApacheJMeter_jdbc.jar │ ├── ApacheJMeter_jms.jar │ ├── ApacheJMeter_junit.jar │ ├── ApacheJMeter_ldap.jar │ ├── ApacheJMeter_mail.jar │ ├── ApacheJMeter_monitors.jar │ ├── ApacheJMeter_native.jar │ ├── ApacheJMeter_report.jar │ └── ApacheJMeter_tcp.jar ├── geronimo-jms_1.1_spec-1.1.1.jar ├── htmllexer-2.1.jar ├── htmlparser-2.1.jar ├── httpclient-4.2.3.jar ├── httpcore-4.2.3.jar ├── httpmime-4.2.3.jar ├── jcharts-0.7.5.jar ├── jdom-1.1.2.jar ├── jodd-core-3.4.1.jar ├── jodd-lagarto-3.4.1.jar ├── jorphan.jar ├── jsoup-1.7.1.jar ├── jtidy-r938.jar ├── junit-4.10.jar ├── junit │ └── test.jar ├── logkit-2.0.jar ├── mail-1.4.4.jar ├── oro-2.0.8.jar ├── rhino-1.7R4.jar ├── serializer-2.7.1.jar ├── slf4j-api-1.7.2.jar ├── soap-2.3.1.jar ├── tika-core-1.3.jar ├── tika-parsers-1.3.jar ├── xalan-2.7.1.jar ├── xercesImpl-2.9.1.jar ├── xml-apis-1.3.04.jar ├── xmlgraphics-commons-1.3.1.jar ├── xmlpull-1.1.3.1.jar ├── xpp3_min-1.1.4c.jar └── xstream-1.4.2.jar └── printable_docs ├── building.html ├── changes.html ├── changes_history.html ├── demos ├── AssertionTestPlan.jmx ├── AuthManagerTestPlan.jmx ├── BeanShellAssertion.bsh ├── ForEachTest2.jmx ├── HeaderManagerTestPlan.jmx ├── InterleaveTestPlan.jmx ├── InterleaveTestPlan2.jmx ├── JDBC-Pre-Post-Processor.jmx ├── JMSPointToPoint.jmx ├── LoopTestPlan.jmx ├── OnceOnlyTestPlan.jmx ├── ProxyServerTestPlan.jmx ├── RegEx-User-Parameters.jmx ├── SimpleTestPlan.jmx ├── URLRewritingExample.jmx └── forEachTestPlan.jmx ├── download_jmeter.html ├── extending └── jmeter_tutorial.pdf ├── index.html ├── issues.html ├── jmeter_irc.html ├── localising └── index.html ├── mail.html ├── mail2.html ├── nightly.html ├── svnindex.html └── usermanual ├── best-practices.html ├── boss.html ├── build-adv-web-test-plan.html ├── build-db-test-plan.html ├── build-ftp-test-plan.html ├── build-jms-point-to-point-test-plan.html ├── build-jms-topic-test-plan.html ├── build-ldap-test-plan.html ├── build-ldapext-test-plan.html ├── build-monitor-test-plan.html ├── build-test-plan.html ├── build-web-test-plan.html ├── build-ws-test-plan.html ├── component_reference.html ├── functions.html ├── get-started.html ├── glossary.html ├── hints_and_tips.html ├── include_controller_tutorial.pdf ├── index.html ├── intro.html ├── jmeter_accesslog_sampler_step_by_step.pdf ├── jmeter_distributed_testing_step_by_step.pdf ├── jmeter_proxy_step_by_step.pdf ├── junitsampler_tutorial.pdf ├── ldapanswer_xml.html ├── ldapops_tutor.html ├── listeners.html ├── regular_expressions.html ├── remote-test.html └── test_plan.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | target 3 | .idea 4 | *.iml 5 | *.log 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | REMOTE_HOST=ec2-54-215-240-14.us-west-1.compute.amazonaws.com 4 | 5 | # Performance Test 6 | perf-test: 7 | mvn clean install -Pperformance 8 | 9 | release: 10 | mvn -f netty-server/pom.xml assembly:assembly 11 | 12 | deploy: 13 | mvn -Dmaven.test.skip=true clean install 14 | mvn -Dmaven.test.skip=true -pl netty-server assembly:assembly 15 | # scp -i ~/Downloads/nbev-zuul.pem netty-server/target/netty-server-1.0-SNAPSHOT-jar-with-dependencies.jar ec2-user@$(REMOTE_HOST): 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | zuul-netty 2 | ========== 3 | 4 | ### Assembling the Project 5 | The project is equipped with the Maven Assembly plugin for producing an executable, deps-included JAR at netty-server/target. 6 | 7 | mvn install && mvn -pl netty-server assembly:assembly 8 | 9 | ### Quick Start 10 | If you don't want to go to the trouble of assembling and running the project then you can start the proxy using the Maven Exec plugin. It will currently just route to google.com. 11 | 12 | mvn install && sudo mvn -pl netty-server exec:java 13 | 14 | ### Filters 15 | - Only pre (-proxy) filters currently supported. 16 | - No dynamic reload currently supported (coming soon.). 17 | 18 | ### Upcoming work 19 | - Dynamic filter reload. 20 | - Post (-proxy) filters. 21 | - Static filters. 22 | - Redirect support from filters. 23 | - Better JMX stats exposure. 24 | - Full filter API documentation. 25 | - Support for filter changes in existing connections. 26 | - Batch isolation of filter changes. 27 | 28 | ### Performance Results 29 | - Testing carried out on [m1.m and m3.2xl instance types in AWS EC2](/performance-tests/performance-ec2.md). 30 | - Testing carried out on [dedicated hardware inside a proprietry datacenter](/performance-tests/performance-dedicated.md). 31 | -------------------------------------------------------------------------------- /netty-framework-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.netflix.zuul 5 | zuul-netty 6 | 1.0-SNAPSHOT 7 | 8 | netty-framework-api 9 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/FrameworkHttpRequest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | import org.jboss.netty.handler.codec.http.HttpMethod; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public interface FrameworkHttpRequest { 9 | 10 | /** 11 | * Returns the method of this request. 12 | */ 13 | HttpMethod getMethod(); 14 | 15 | /** 16 | * Returns the URI (or path) of this request. 17 | */ 18 | String getUri(); 19 | 20 | /** 21 | * Sets the URI (or path) of this request. 22 | */ 23 | void setUri(String uri); 24 | 25 | /** 26 | * Returns the header value with the specified header name. If there are 27 | * more than one header value for the specified header name, the first 28 | * value is returned. 29 | * 30 | * @return the header value or {@code null} if there is no such header 31 | */ 32 | String getHeader(String name); 33 | 34 | /** 35 | * Returns {@code true} if and only if there is a header with the specified 36 | * header name. 37 | */ 38 | boolean containsHeader(String name); 39 | 40 | /** 41 | * Adds a new header with the specified name and value. 42 | */ 43 | void addHeader(String name, Object value); 44 | 45 | /** 46 | * Returns the all header names and values that this message contains. 47 | * 48 | * @return the {@link List} of the header name-value pairs. An empty list 49 | * if there is no header in this message. 50 | */ 51 | List> getHeaders(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/FrameworkHttpResponse.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | 7 | public interface FrameworkHttpResponse { 8 | 9 | /** 10 | * Returns the header value with the specified header name. If there are 11 | * more than one header value for the specified header name, the first 12 | * value is returned. 13 | * 14 | * @return the header value or {@code null} if there is no such header 15 | */ 16 | String getHeader(String name); 17 | 18 | /** 19 | * Returns {@code true} if and only if there is a header with the specified 20 | * header name. 21 | */ 22 | boolean containsHeader(String name); 23 | 24 | /** 25 | * Adds a new header with the specified name and value. 26 | */ 27 | void addHeader(String name, Object value); 28 | 29 | /** 30 | * Returns the all header names and values that this message contains. 31 | * 32 | * @return the {@link List} of the header name-value pairs. An empty list 33 | * if there is no header in this message. 34 | */ 35 | List> getHeaders(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpRequestHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | public interface HttpRequestHandler { 4 | 5 | void requestReceived(FrameworkHttpRequest request); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpRequestHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | 4 | public interface HttpRequestHandlerFactory { 5 | 6 | HttpRequestHandler getInstance(String tag, com.netflix.zuul.proxy.framework.api.Interrupts interrupts); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | public interface HttpResponseHandler { 4 | 5 | void responseReceived(FrameworkHttpRequest request, FrameworkHttpResponse response); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpResponseHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | 4 | public interface HttpResponseHandlerFactory { 5 | 6 | HttpResponseHandler getInstance(String tag); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/Interrupts.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | public interface Interrupts { 4 | 5 | void movedPermanently (String location); 6 | void temporaryRedirect (String location); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/Route.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.api; 2 | 3 | public class Route { 4 | 5 | public static final String ROUTE_HEADER = "com.netflix.zuul.route"; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /netty-framework-plugins/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.netflix.zuul 5 | zuul-netty 6 | 1.0-SNAPSHOT 7 | 8 | netty-framework-plugins 9 | 10 | 11 | 12 | com.netflix.zuul 13 | netty-framework-api 14 | compile 15 | ${project.version} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /netty-framework-plugins/src/main/java/com/netflix/zuul/proxy/framework/plugins/GlobalRedirectRequestHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.plugins; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandler; 5 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandlerFactory; 6 | import com.netflix.zuul.proxy.framework.api.Interrupts; 7 | import org.jboss.netty.handler.codec.http.HttpMethod; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import static org.jboss.netty.handler.codec.http.HttpMethod.GET; 12 | 13 | public class GlobalRedirectRequestHandler implements HttpRequestHandler { 14 | 15 | private static final Logger LOG = LoggerFactory.getLogger(GlobalRedirectRequestHandler.class); 16 | 17 | private final Interrupts interrupts; 18 | private final String tag; 19 | 20 | private GlobalRedirectRequestHandler(String tag, Interrupts interrupts) { 21 | this.interrupts = interrupts; 22 | this.tag = tag; 23 | } 24 | 25 | 26 | @Override 27 | public void requestReceived(FrameworkHttpRequest request) { 28 | LOG.debug("{} - {}", tag, request.getUri()); 29 | switch (request.getUri()) { 30 | case "/old-location": 31 | interrupts.movedPermanently("/new-location"); 32 | } 33 | } 34 | 35 | public static final HttpRequestHandlerFactory FACTORY = new HttpRequestHandlerFactory() { 36 | @Override 37 | public HttpRequestHandler getInstance(String tag, Interrupts interrupts) { 38 | return new GlobalRedirectRequestHandler(tag, interrupts); 39 | } 40 | }; 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /netty-framework-plugins/src/main/java/com/netflix/zuul/proxy/framework/plugins/GlobalRewriteRequestHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.plugins; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandler; 5 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandlerFactory; 6 | import com.netflix.zuul.proxy.framework.api.Interrupts; 7 | 8 | public class GlobalRewriteRequestHandler implements HttpRequestHandler { 9 | 10 | @Override 11 | public void requestReceived(FrameworkHttpRequest request) { 12 | switch (request.getUri()) { 13 | case "/foo": 14 | request.setUri(String.format("/bar")); 15 | } 16 | } 17 | 18 | public static final HttpRequestHandlerFactory FACTORY = new HttpRequestHandlerFactory() { 19 | @Override 20 | public HttpRequestHandler getInstance(String tag, Interrupts actionCallback) { 21 | return new GlobalRewriteRequestHandler(); 22 | } 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /netty-framework-plugins/src/main/java/com/netflix/zuul/proxy/framework/plugins/LoggingRequestHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.plugins; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandler; 5 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandlerFactory; 6 | import com.netflix.zuul.proxy.framework.api.Interrupts; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class LoggingRequestHandler implements HttpRequestHandler { 11 | 12 | private static final Logger LOG = LoggerFactory.getLogger(LoggingRequestHandler.class); 13 | 14 | private final String tag; 15 | 16 | private LoggingRequestHandler(String tag) { 17 | this.tag = tag; 18 | } 19 | 20 | @Override 21 | public void requestReceived(FrameworkHttpRequest request) { 22 | LOG.debug("{} - received request: {} {}", tag, request.getUri(), request.getHeaders()); 23 | } 24 | 25 | public static final HttpRequestHandlerFactory FACTORY = new HttpRequestHandlerFactory() { 26 | @Override 27 | public HttpRequestHandler getInstance(String tag, Interrupts actionCallback) { 28 | return new LoggingRequestHandler(tag); 29 | } 30 | }; 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /netty-framework-plugins/src/main/java/com/netflix/zuul/proxy/framework/plugins/LoggingResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.framework.plugins; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpResponse; 5 | import com.netflix.zuul.proxy.framework.api.HttpResponseHandler; 6 | import com.netflix.zuul.proxy.framework.api.HttpResponseHandlerFactory; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class LoggingResponseHandler implements HttpResponseHandler { 11 | 12 | private static final Logger LOG = LoggerFactory.getLogger(LoggingResponseHandler.class); 13 | 14 | private final String tag; 15 | 16 | public LoggingResponseHandler(String tag) { 17 | this.tag = tag; 18 | } 19 | 20 | @Override 21 | public void responseReceived(FrameworkHttpRequest request, FrameworkHttpResponse response) { 22 | LOG.debug("{} - received response: {}", tag, response.getHeaders()); 23 | response.addHeader("X-hcom-some-plugin-header", "some data"); 24 | } 25 | 26 | public static final HttpResponseHandlerFactory FACTORY = new HttpResponseHandlerFactory() { 27 | @Override 28 | public HttpResponseHandler getInstance(String tag) { 29 | return new LoggingResponseHandler(tag); 30 | } 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /netty-mock-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.netflix.zuul 5 | zuul-netty 6 | 1.0-SNAPSHOT 7 | 8 | netty-mock-server 9 | 10 | 11 | 12 | com.netflix.zuul 13 | netty-server 14 | compile 15 | ${project.version} 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.codehaus.mojo 23 | exec-maven-plugin 24 | 1.2.1 25 | 26 | com.hotels.architecture.proxy.MockEndpoint 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /netty-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.netflix.zuul 6 | zuul-netty 7 | 1.0-SNAPSHOT 8 | 9 | netty-server 10 | 11 | 12 | 13 | com.google.guava 14 | guava 15 | 14.0.1 16 | 17 | 18 | com.netflix.zuul 19 | zuul-core 20 | ${project.version} 21 | 22 | 23 | com.netflix.zuul 24 | netty-framework-api 25 | compile 26 | ${project.version} 27 | 28 | 29 | com.netflix.zuul 30 | netty-framework-plugins 31 | compile 32 | ${project.version} 33 | 34 | 35 | commons-pool 36 | commons-pool 37 | 1.6 38 | 39 | 40 | com.yammer.metrics 41 | metrics-core 42 | 2.2.0 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.codehaus.mojo 50 | exec-maven-plugin 51 | 1.2.1 52 | 53 | com.netflix.zuul.proxy.ProxyServer 54 | 55 | 80 56 | /Users/nbeveridge/Development/git/zuul-netty/zuul-core/src/main/filters/pre 57 | 58 | 59 | 60 | 61 | maven-assembly-plugin 62 | 2.4 63 | 64 | 65 | jar-with-dependencies 66 | 67 | 68 | 69 | com.netflix.zuul.proxy.ProxyServer 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/HttpOutboundPipeline.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy; 2 | 3 | import com.netflix.zuul.proxy.handler.ClientTimingHandler; 4 | import com.netflix.zuul.proxy.handler.ExceptionSurfacerHandler; 5 | import com.netflix.zuul.proxy.handler.IdleChannelWatchdog; 6 | import org.jboss.netty.channel.ChannelHandler; 7 | import org.jboss.netty.channel.ChannelPipeline; 8 | import org.jboss.netty.channel.ChannelPipelineFactory; 9 | import org.jboss.netty.handler.codec.http.HttpContentCompressor; 10 | import org.jboss.netty.handler.codec.http.HttpContentDecompressor; 11 | import org.jboss.netty.handler.codec.http.HttpRequestEncoder; 12 | import org.jboss.netty.handler.codec.http.HttpResponseDecoder; 13 | import org.jboss.netty.handler.logging.LoggingHandler; 14 | import org.jboss.netty.handler.timeout.IdleStateHandler; 15 | import org.jboss.netty.logging.InternalLogLevel; 16 | import org.jboss.netty.util.Timer; 17 | 18 | import static org.jboss.netty.channel.Channels.pipeline; 19 | 20 | public class HttpOutboundPipeline implements ChannelPipelineFactory { 21 | 22 | private static final int RESPONSE_MAX_INITIAL_LINE_LENGTH = 4096; 23 | private static final int RESPONSE_MAX_HEADER_SIZE = (1024*8); 24 | private static final int RESPONSE_MAX_CHUNK_SIZE = (1024*8); 25 | 26 | //seconds until the TCP connection will close 27 | private static final int IDLE_TIMEOUT_READER = 0; 28 | private static final int IDLE_TIMEOUT_WRITER = 0; 29 | private static final int IDLE_TIMEOUT_BOTH = 10; 30 | 31 | private static final ChannelHandler EXCEPTION_SURFACER = new ExceptionSurfacerHandler(); 32 | private final ChannelHandler IDLE_STATE_HANDLER; 33 | 34 | public HttpOutboundPipeline (Timer timer) { 35 | IDLE_STATE_HANDLER = new IdleStateHandler(timer, IDLE_TIMEOUT_READER, IDLE_TIMEOUT_WRITER, IDLE_TIMEOUT_BOTH); 36 | } 37 | 38 | @Override 39 | public ChannelPipeline getPipeline() throws Exception { 40 | ChannelPipeline pipeline = pipeline(); 41 | 42 | pipeline.addLast("idle-detection", IDLE_STATE_HANDLER); 43 | pipeline.addLast("logging", new LoggingHandler(InternalLogLevel.DEBUG)); 44 | pipeline.addLast("http-deflater", new HttpContentCompressor()); 45 | pipeline.addLast("decoder", new HttpResponseDecoder(RESPONSE_MAX_INITIAL_LINE_LENGTH, RESPONSE_MAX_HEADER_SIZE, RESPONSE_MAX_CHUNK_SIZE)); 46 | pipeline.addLast("encoder", new HttpRequestEncoder()); 47 | pipeline.addLast("http-inflater", new HttpContentDecompressor()); 48 | pipeline.addLast("remote-hop-timer", new ClientTimingHandler("outbound")); 49 | pipeline.addLast("exception-surfacer", EXCEPTION_SURFACER); 50 | pipeline.addLast("idle-watchdog", new IdleChannelWatchdog("outbound")); 51 | 52 | return pipeline; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/HttpServer.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy; 2 | 3 | import com.yammer.metrics.Metrics; 4 | import com.yammer.metrics.reporting.JmxReporter; 5 | import org.jboss.netty.bootstrap.ServerBootstrap; 6 | import org.jboss.netty.channel.Channel; 7 | import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; 8 | import org.jboss.netty.logging.InternalLoggerFactory; 9 | import org.jboss.netty.logging.Slf4JLoggerFactory; 10 | import org.jboss.netty.util.HashedWheelTimer; 11 | import org.jboss.netty.util.Timer; 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | 15 | import java.net.InetSocketAddress; 16 | import java.util.concurrent.Executors; 17 | 18 | public class HttpServer { 19 | 20 | private static final Timer TIMER = new HashedWheelTimer(); 21 | private static final Logger LOG = LoggerFactory.getLogger(HttpServer.class); 22 | 23 | private final int port; 24 | private Channel channel; 25 | 26 | public HttpServer(int port) { 27 | this.port = port; 28 | } 29 | 30 | public synchronized void run() { 31 | // Configure the server. 32 | ServerBootstrap b = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); 33 | 34 | b.setPipelineFactory(new CommonHttpPipeline(TIMER)); 35 | b.setOption("child.tcpNoDelay", true); 36 | channel = b.bind(new InetSocketAddress(port)); 37 | LOG.info("server bound to port {}", port); 38 | } 39 | 40 | public static void main(String[] args) { 41 | InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory()); 42 | 43 | LOG.info("Starting server..."); 44 | new HttpServer(80).run(); 45 | 46 | JmxReporter.startDefault(Metrics.defaultRegistry()); 47 | 48 | //ConsoleReporter.enable(1, TimeUnit.SECONDS); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/IllegalRouteException.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: nbeveridge 6 | * Date: 12/09/2013 7 | * Time: 12:50 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | public class IllegalRouteException extends Exception { 11 | private final String route; 12 | 13 | public IllegalRouteException(String route) { 14 | super(); //To change body of overridden methods use File | Settings | File Templates. 15 | this.route = route; 16 | } 17 | 18 | public IllegalRouteException(String route, String message) { 19 | super(message); //To change body of overridden methods use File | Settings | File Templates. 20 | this.route = route; 21 | } 22 | 23 | public IllegalRouteException(String route, String message, Throwable cause) { 24 | super(message, cause); //To change body of overridden methods use File | Settings | File Templates. 25 | this.route = route; 26 | } 27 | 28 | public IllegalRouteException(String route, Throwable cause) { 29 | super(cause); //To change body of overridden methods use File | Settings | File Templates. 30 | this.route = route; 31 | } 32 | 33 | public String getRoute() { 34 | return route; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/core/Connection.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.core; 2 | 3 | import org.jboss.netty.channel.Channel; 4 | import org.jboss.netty.channel.ChannelFuture; 5 | 6 | import java.net.URL; 7 | 8 | public class Connection { 9 | 10 | private final URL routeHost; 11 | private final ChannelFuture channelFuture; 12 | private final String id; 13 | 14 | public Connection(URL routeHost, ChannelFuture channelFuture) { 15 | this.routeHost = routeHost; 16 | this.channelFuture = channelFuture; 17 | this.id = Integer.toHexString(channelFuture.getChannel().getId()); 18 | } 19 | 20 | public URL getRouteHost() { 21 | return routeHost; 22 | } 23 | 24 | public Channel getChannel() { 25 | return channelFuture.getChannel(); 26 | } 27 | 28 | public ChannelFuture getChannelFuture() { 29 | return channelFuture; 30 | } 31 | 32 | public String getId() { 33 | return id; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/core/ConnectionPool.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.core; 2 | 3 | import com.netflix.zuul.proxy.IllegalRouteException; 4 | 5 | import java.net.URL; 6 | 7 | public interface ConnectionPool { 8 | 9 | Connection borrow(URL routeHost) 10 | throws IllegalRouteException; 11 | 12 | void release(Connection channel); 13 | 14 | void destroy(Connection channel); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/core/InterruptsImpl.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.core; 2 | 3 | import com.netflix.zuul.proxy.framework.api.Interrupts; 4 | import org.jboss.netty.channel.Channel; 5 | import org.jboss.netty.channel.ChannelFuture; 6 | import org.jboss.netty.channel.ChannelFutureListener; 7 | import org.jboss.netty.handler.codec.http.DefaultHttpResponse; 8 | import org.jboss.netty.handler.codec.http.HttpRequest; 9 | import org.jboss.netty.handler.codec.http.HttpResponse; 10 | 11 | import static org.jboss.netty.handler.codec.http.HttpHeaders.isKeepAlive; 12 | import static org.jboss.netty.handler.codec.http.HttpResponseStatus.MOVED_PERMANENTLY; 13 | import static org.jboss.netty.handler.codec.http.HttpResponseStatus.TEMPORARY_REDIRECT; 14 | import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; 15 | 16 | public class InterruptsImpl implements Interrupts { 17 | 18 | private final HttpRequest httpRequest; 19 | private final Channel channel; 20 | private boolean interrupted = false; 21 | 22 | public InterruptsImpl(HttpRequest httpRequest, Channel channel) { 23 | this.httpRequest = httpRequest; 24 | this.channel = channel; 25 | } 26 | 27 | @Override 28 | public void movedPermanently(String location) { 29 | HttpResponse response = new DefaultHttpResponse(HTTP_1_1, MOVED_PERMANENTLY); 30 | response.addHeader("Location", location); 31 | write(response); 32 | } 33 | 34 | @Override 35 | public void temporaryRedirect(String location) { 36 | HttpResponse response = new DefaultHttpResponse(HTTP_1_1, TEMPORARY_REDIRECT); 37 | response.addHeader("Location", location); 38 | write(response); 39 | } 40 | 41 | private void write(HttpResponse httpResponse) { 42 | ChannelFuture future = channel.write(httpResponse); 43 | 44 | if (!isKeepAlive(httpRequest)) { 45 | future.addListener(ChannelFutureListener.CLOSE); 46 | } 47 | 48 | this.interrupted = true; 49 | } 50 | 51 | /** 52 | * An action was performed which requires that onward request processing is interrupted 53 | * @return onward processing should be interrupted 54 | */ 55 | public boolean isInterrupted() { 56 | return interrupted; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/ClientTimingHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.yammer.metrics.Metrics; 4 | import com.yammer.metrics.core.Timer; 5 | import com.yammer.metrics.core.TimerContext; 6 | import org.jboss.netty.channel.ChannelHandlerContext; 7 | import org.jboss.netty.channel.ChannelStateEvent; 8 | import org.jboss.netty.channel.MessageEvent; 9 | import org.jboss.netty.channel.SimpleChannelHandler; 10 | import org.jboss.netty.handler.codec.http.HttpChunk; 11 | import org.jboss.netty.handler.codec.http.HttpMessage; 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | 15 | import java.util.concurrent.TimeUnit; 16 | 17 | public class ClientTimingHandler extends SimpleChannelHandler { 18 | 19 | private static final Logger LOG = LoggerFactory.getLogger(ClientTimingHandler.class); 20 | private static final double NANO_TO_MS = 1000000d; 21 | private final String tag; 22 | private final Timer connectTimer = Metrics.newTimer(com.netflix.zuul.proxy.handler.ServerTimingHandler.class, "outbound-connect", TimeUnit.MICROSECONDS, TimeUnit.SECONDS); 23 | private final Timer exchangeTimer = Metrics.newTimer(com.netflix.zuul.proxy.handler.ServerTimingHandler.class, "outbound-exchange", TimeUnit.MICROSECONDS, TimeUnit.SECONDS); 24 | private TimerContext connectContext; 25 | private TimerContext exchangeContext; 26 | 27 | private long connectStart; 28 | private long writeStart; 29 | 30 | public ClientTimingHandler(String tag) { 31 | this.tag = tag; 32 | } 33 | 34 | @Override 35 | public void connectRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { 36 | this.connectStart = System.nanoTime(); 37 | this.connectContext = connectTimer.time(); 38 | super.connectRequested(ctx, e); 39 | } 40 | 41 | @Override 42 | public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { 43 | LOG.info("timer {} - connect took: {}ms", tag, String.format("%.2f", (System.nanoTime() - connectStart) / NANO_TO_MS)); 44 | connectContext.stop(); 45 | super.channelConnected(ctx, e); 46 | } 47 | 48 | @Override 49 | public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 50 | this.writeStart = System.nanoTime(); 51 | this.exchangeContext = exchangeTimer.time(); 52 | super.writeRequested(ctx, e); 53 | } 54 | 55 | @Override 56 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 57 | if (e.getMessage() instanceof HttpChunk) { 58 | if (((HttpChunk) e.getMessage()).isLast()) { 59 | logDifference(System.nanoTime() - writeStart); 60 | exchangeContext.stop(); 61 | } 62 | } else if (e.getMessage() instanceof HttpMessage) { 63 | if (!((HttpMessage) e.getMessage()).isChunked()) { 64 | logDifference(System.nanoTime() - writeStart); 65 | exchangeContext.stop(); 66 | } 67 | } else { 68 | logDifference(System.nanoTime() - writeStart); 69 | exchangeContext.stop(); 70 | } 71 | 72 | super.messageReceived(ctx, e); 73 | } 74 | 75 | private void logDifference(long nano) { 76 | LOG.info("timer {} - exchange took: {}ms", tag, String.format("%.2f", nano / NANO_TO_MS)); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/ExceptionSurfacerHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelHandlerContext; 4 | import org.jboss.netty.channel.ChannelStateEvent; 5 | import org.jboss.netty.channel.ExceptionEvent; 6 | import org.jboss.netty.channel.SimpleChannelHandler; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class ExceptionSurfacerHandler extends SimpleChannelHandler { 11 | 12 | private static final Logger LOG = LoggerFactory.getLogger(ExceptionSurfacerHandler.class); 13 | 14 | @Override 15 | public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { 16 | LOG.debug("channel failed {}", Integer.toHexString(e.getChannel().getId()), e.getCause()); 17 | } 18 | 19 | @Override 20 | public void closeRequested(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { 21 | LOG.debug("channel close requested {}", Integer.toHexString(e.getChannel().getId())); 22 | super.closeRequested(ctx, e); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelHandler; 4 | 5 | public interface HandlerFactory { 6 | ChannelHandler getInstance(); 7 | } 8 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpAppResolvingHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelHandlerContext; 4 | import org.jboss.netty.channel.MessageEvent; 5 | import org.jboss.netty.channel.SimpleChannelUpstreamHandler; 6 | import org.jboss.netty.handler.codec.http.HttpRequest; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | import java.net.URL; 11 | 12 | import static com.netflix.zuul.proxy.framework.api.Route.ROUTE_HEADER; 13 | 14 | public class HttpAppResolvingHandler extends SimpleChannelUpstreamHandler { 15 | private static final Logger LOG = LoggerFactory.getLogger(HttpAppResolvingHandler.class); 16 | private static final String STATIC_ROUTE = "http://localhost:8081"; 17 | 18 | @Override 19 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 20 | //only set this on request - proceeding chunks will be routed on same outbound connection 21 | if (e.getMessage() instanceof HttpRequest) { 22 | HttpRequest request = (HttpRequest) e.getMessage(); 23 | 24 | request.setHeader(ROUTE_HEADER, STATIC_ROUTE); 25 | LOG.debug("setting header {} to {}", ROUTE_HEADER, STATIC_ROUTE); 26 | 27 | request.setHeader("host", new URL(STATIC_ROUTE).getHost()); 28 | } 29 | 30 | super.messageReceived(ctx, e); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpKeepAliveHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelFutureListener; 4 | import org.jboss.netty.channel.ChannelHandlerContext; 5 | import org.jboss.netty.channel.MessageEvent; 6 | import org.jboss.netty.handler.codec.http.HttpChunk; 7 | import org.jboss.netty.handler.codec.http.HttpHeaders; 8 | import org.jboss.netty.handler.codec.http.HttpRequest; 9 | import org.jboss.netty.handler.codec.http.HttpResponse; 10 | import org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONNECTION; 15 | import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH; 16 | import static org.jboss.netty.handler.codec.http.HttpHeaders.isKeepAlive; 17 | 18 | public class HttpKeepAliveHandler extends IdleStateAwareChannelHandler { 19 | 20 | private static final Logger LOG = LoggerFactory.getLogger(HttpKeepAliveHandler.class); 21 | 22 | private final boolean isKeepAliveSupported; 23 | 24 | public HttpKeepAliveHandler(boolean isKeepAliveSupported) { 25 | this.isKeepAliveSupported = isKeepAliveSupported; 26 | } 27 | 28 | @Override 29 | public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 30 | HttpRequest request = (HttpRequest) ctx.getAttachment(); 31 | 32 | if (e.getMessage() instanceof HttpResponse) { 33 | 34 | HttpResponse response = (HttpResponse) e.getMessage(); 35 | 36 | if (!response.isChunked()) { 37 | 38 | if (isKeepAliveSupported && isKeepAlive(request)) { 39 | 40 | LOG.debug("keep-alive IS implemented for this connection"); 41 | 42 | // Add 'Content-Length' header only for a keep-alive connection. 43 | response.setHeader(CONTENT_LENGTH, response.getContent().readableBytes()); 44 | // Add keep alive header as per: 45 | // - http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01.html#Connection 46 | response.setHeader(CONNECTION, HttpHeaders.Values.KEEP_ALIVE); 47 | 48 | } else { 49 | 50 | //not chunked and keep alive not supported, closing connection 51 | LOG.debug("keep-alive NOT implemented for this connection"); 52 | e.getFuture().addListener(ChannelFutureListener.CLOSE); 53 | 54 | } 55 | 56 | } else { 57 | //response is chunked 58 | 59 | //don't send a content-length for chunked transfer-encoding 60 | response.removeHeader(CONTENT_LENGTH); 61 | 62 | //keep-alive explicitly off 63 | if (!isKeepAliveSupported || !isKeepAlive(request)) { 64 | response.removeHeader(CONNECTION); 65 | LOG.debug("keep-alive NOT implemented for this connection as it is explicitly turned off"); 66 | } else { 67 | LOG.debug("keep-alive IMPLIED for this connection as it is chunked"); 68 | } 69 | } 70 | } else if (e.getMessage() instanceof HttpChunk) { 71 | LOG.debug("found chunk"); 72 | if (((HttpChunk) e.getMessage()).isLast()) { 73 | 74 | if (!isKeepAliveSupported || !isKeepAlive(request)) { 75 | //keep alive explicitly off 76 | LOG.debug("reached the last chunk and keep alive is turned off so closing the connection"); 77 | e.getFuture().addListener(ChannelFutureListener.CLOSE); 78 | } 79 | 80 | } 81 | } else { 82 | LOG.debug("found something else"); 83 | } 84 | 85 | super.writeRequested(ctx, e); 86 | } 87 | 88 | @Override 89 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 90 | if (e.getMessage() instanceof HttpRequest && isKeepAliveSupported) { 91 | ctx.setAttachment(e.getMessage()); 92 | } 93 | super.messageReceived(ctx, e); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpRequestFrameworkAdapter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import org.jboss.netty.handler.codec.http.HttpMethod; 5 | import org.jboss.netty.handler.codec.http.HttpRequest; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * Created with IntelliJ IDEA. 12 | * User: nbeveridge 13 | * Date: 12/09/2013 14 | * Time: 13:48 15 | * To change this template use File | Settings | File Templates. 16 | */ 17 | class HttpRequestFrameworkAdapter implements FrameworkHttpRequest { 18 | 19 | private final HttpRequest request; 20 | 21 | HttpRequestFrameworkAdapter(HttpRequest request) { 22 | this.request = request; 23 | } 24 | 25 | @Override 26 | public HttpMethod getMethod() { 27 | return request.getMethod(); 28 | } 29 | 30 | @Override 31 | public String getUri() { 32 | return request.getUri(); 33 | } 34 | 35 | @Override 36 | public String getHeader(String name) { 37 | return request.getHeader(name); 38 | } 39 | 40 | @Override 41 | public boolean containsHeader(String name) { 42 | return request.containsHeader(name); 43 | } 44 | 45 | @Override 46 | public void addHeader(String name, Object value) { 47 | request.addHeader(name, value); 48 | } 49 | 50 | @Override 51 | public void setUri(String uri) { 52 | request.setUri(uri); 53 | } 54 | 55 | @Override 56 | public List> getHeaders() { 57 | return request.getHeaders(); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpRequestFrameworkHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.netflix.zuul.proxy.core.InterruptsImpl; 4 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandler; 5 | import org.jboss.netty.channel.ChannelHandlerContext; 6 | import org.jboss.netty.channel.MessageEvent; 7 | import org.jboss.netty.channel.SimpleChannelUpstreamHandler; 8 | import org.jboss.netty.handler.codec.http.HttpChunk; 9 | import org.jboss.netty.handler.codec.http.HttpRequest; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | public class HttpRequestFrameworkHandler extends SimpleChannelUpstreamHandler { 14 | 15 | private static final Logger LOG = LoggerFactory.getLogger(HttpRequestFrameworkHandler.class); 16 | 17 | private final HttpRequestHandler requestHandler; 18 | private final String tag; 19 | 20 | public HttpRequestFrameworkHandler(String tag, HttpRequestHandler httpRequestHandler) { 21 | this.requestHandler = httpRequestHandler; 22 | this.tag = tag; 23 | } 24 | 25 | @Override 26 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 27 | if (e.getMessage() instanceof HttpRequest) { 28 | HttpRequest request = (HttpRequest) e.getMessage(); 29 | InterruptsImpl callback = new InterruptsImpl(request, e.getChannel()); 30 | LOG.debug("handler: {} is calling request-handler: {}", tag, requestHandler.getClass().getSimpleName()); 31 | requestHandler.requestReceived(new HttpRequestFrameworkAdapter(request)); 32 | 33 | 34 | if (callback.isInterrupted()) { 35 | //plugin requested that execution is interrupted i.e. not passed down the pipeline 36 | return; 37 | } 38 | } else if (e.getMessage() instanceof HttpChunk) { 39 | LOG.debug("encountered a chunk, not passed to handler"); 40 | } 41 | 42 | super.messageReceived(ctx, e); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpResponseFrameworkAdapter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpResponse; 4 | import org.jboss.netty.handler.codec.http.HttpResponse; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * Created with IntelliJ IDEA. 11 | * User: nbeveridge 12 | * Date: 12/09/2013 13 | * Time: 13:49 14 | * To change this template use File | Settings | File Templates. 15 | */ 16 | class HttpResponseFrameworkAdapter implements FrameworkHttpResponse { 17 | 18 | private final HttpResponse response; 19 | 20 | HttpResponseFrameworkAdapter(HttpResponse response) { 21 | this.response = response; 22 | } 23 | 24 | @Override 25 | public String getHeader(String name) { 26 | return response.getHeader(name); 27 | } 28 | 29 | @Override 30 | public boolean containsHeader(String name) { 31 | return response.containsHeader(name); 32 | } 33 | 34 | @Override 35 | public void addHeader(String name, Object value) { 36 | response.addHeader(name, value); 37 | } 38 | 39 | @Override 40 | public List> getHeaders() { 41 | return response.getHeaders(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/HttpResponseFrameworkHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.netflix.zuul.proxy.framework.api.HttpResponseHandler; 4 | import org.jboss.netty.channel.ChannelHandlerContext; 5 | import org.jboss.netty.channel.MessageEvent; 6 | import org.jboss.netty.channel.SimpleChannelHandler; 7 | import org.jboss.netty.handler.codec.http.HttpChunk; 8 | import org.jboss.netty.handler.codec.http.HttpRequest; 9 | import org.jboss.netty.handler.codec.http.HttpResponse; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | public class HttpResponseFrameworkHandler extends SimpleChannelHandler { 14 | 15 | private static final Logger LOG = LoggerFactory.getLogger(HttpResponseFrameworkHandler.class); 16 | 17 | private final HttpResponseHandler responseHandler; 18 | private final String tag; 19 | 20 | public HttpResponseFrameworkHandler(String tag, HttpResponseHandler httpResponseHandler) { 21 | this.responseHandler = httpResponseHandler; 22 | this.tag = tag; 23 | } 24 | 25 | @Override 26 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 27 | LOG.debug("attaching message: {}", e.getMessage().getClass().getSimpleName()); 28 | if (e.getMessage() instanceof HttpRequest) { 29 | ctx.setAttachment(e.getMessage()); 30 | } 31 | super.messageReceived(ctx, e); 32 | } 33 | 34 | @Override 35 | public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 36 | if (e.getMessage() instanceof HttpResponse) { 37 | HttpResponse response = (HttpResponse) e.getMessage(); 38 | HttpRequest request = (HttpRequest) ctx.getAttachment(); 39 | 40 | LOG.debug("handler: {} is calling response-handler: {}", tag, responseHandler.getClass().getSimpleName()); 41 | responseHandler.responseReceived(new HttpRequestFrameworkAdapter(request), new HttpResponseFrameworkAdapter(response)); 42 | 43 | ctx.setAttachment(null); 44 | } else if (e.getMessage() instanceof HttpChunk) { 45 | LOG.debug("encountered a chunk, not passed to handler"); 46 | } 47 | 48 | super.writeRequested(ctx, e); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/IdleChannelWatchdog.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelFuture; 4 | import org.jboss.netty.channel.ChannelFutureListener; 5 | import org.jboss.netty.channel.ChannelHandlerContext; 6 | import org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler; 7 | import org.jboss.netty.handler.timeout.IdleStateEvent; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | /** 12 | * Created with IntelliJ IDEA. 13 | * User: nbeveridge 14 | * Date: 12/09/2013 15 | * Time: 19:25 16 | * To change this template use File | Settings | File Templates. 17 | */ 18 | public class IdleChannelWatchdog extends IdleStateAwareChannelHandler { 19 | private static final Logger LOG = LoggerFactory.getLogger(IdleChannelWatchdog.class); 20 | 21 | private final String channelName; 22 | 23 | public IdleChannelWatchdog (String channelName) { 24 | this.channelName = channelName; 25 | } 26 | 27 | @Override 28 | public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { 29 | LOG.info("closing {} channel after {} event was intercepted", channelName, e.getState().toString()); 30 | 31 | e.getChannel().close().addListener(new ChannelFutureListener() { 32 | @Override 33 | public void operationComplete(ChannelFuture future) throws Exception { 34 | if (future.isSuccess()) { 35 | LOG.info("{} channel closed cleanly", channelName); 36 | } else { 37 | LOG.info("{} channel failed to close cleanly", channelName); 38 | } 39 | } 40 | }); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/ServerTimingHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import com.yammer.metrics.Metrics; 4 | import com.yammer.metrics.core.Timer; 5 | import com.yammer.metrics.core.TimerContext; 6 | import org.jboss.netty.channel.ChannelHandlerContext; 7 | import org.jboss.netty.channel.MessageEvent; 8 | import org.jboss.netty.channel.SimpleChannelHandler; 9 | import org.jboss.netty.handler.codec.http.HttpChunk; 10 | import org.jboss.netty.handler.codec.http.HttpMessage; 11 | import org.jboss.netty.handler.codec.http.HttpRequest; 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | 15 | import java.util.concurrent.TimeUnit; 16 | 17 | public class ServerTimingHandler extends SimpleChannelHandler { 18 | 19 | private static final Logger LOG = LoggerFactory.getLogger(ServerTimingHandler.class); 20 | private static final double NANO_TO_MS = 1000000d; 21 | private final String tag; 22 | private final Timer timer = Metrics.newTimer(ServerTimingHandler.class, "inbound-requests", TimeUnit.MICROSECONDS, TimeUnit.SECONDS); 23 | private TimerContext context; 24 | private long start; 25 | 26 | public ServerTimingHandler(String tag) { 27 | this.tag = tag; 28 | } 29 | 30 | @Override 31 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 32 | if (e.getMessage() instanceof HttpRequest) { 33 | this.context = timer.time(); 34 | this.start = System.nanoTime(); 35 | } 36 | 37 | super.messageReceived(ctx, e); 38 | } 39 | 40 | @Override 41 | public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 42 | if (e.getMessage() instanceof HttpChunk) { 43 | if (((HttpChunk) e.getMessage()).isLast()) { 44 | context.stop(); 45 | logDifference(System.nanoTime() - start); 46 | LOG.debug("saw last chunk"); 47 | } 48 | } else if (e.getMessage() instanceof HttpMessage) { 49 | if (!((HttpMessage) e.getMessage()).isChunked()) { 50 | context.stop(); 51 | logDifference(System.nanoTime() - start); 52 | } 53 | LOG.debug("headers: {}", ((HttpMessage) e.getMessage()).getHeaders()); 54 | } else { 55 | context.stop(); 56 | logDifference(System.nanoTime() - start); 57 | } 58 | 59 | LOG.debug("saw message {}", e.getMessage()); 60 | 61 | super.writeRequested(ctx, e); 62 | } 63 | 64 | private void logDifference(long nano) { 65 | LOG.info("timer {} - exchange took: {}ms", tag, String.format("%.2f", nano / NANO_TO_MS)); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /netty-server/src/main/java/com/netflix/zuul/proxy/handler/SocketSuspensionHandler.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy.handler; 2 | 3 | import org.jboss.netty.channel.ChannelHandlerContext; 4 | import org.jboss.netty.channel.MessageEvent; 5 | import org.jboss.netty.channel.SimpleChannelHandler; 6 | 7 | public class SocketSuspensionHandler extends SimpleChannelHandler { 8 | 9 | @Override 10 | public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 11 | e.getChannel().setReadable(true); 12 | 13 | super.writeRequested(ctx, e); 14 | } 15 | 16 | @Override 17 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 18 | e.getChannel().setReadable(false); 19 | 20 | super.messageReceived(ctx, e); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /netty-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /netty-server/src/test/java/com/netflix/zuul/proxy/HttpServerTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * @author HWEB 7 | */ 8 | public class HttpServerTest { 9 | 10 | private HttpServer httpServer; 11 | 12 | @Test 13 | public void registeresHandlersOnceServerStarted() throws Exception { 14 | httpServer = new HttpServer(9090); 15 | 16 | 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /netty-server/src/test/java/com/netflix/zuul/proxy/ProxyServerTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.proxy; 2 | 3 | import org.junit.After; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertTrue; 7 | 8 | /** 9 | * @author HWEB 10 | */ 11 | public class ProxyServerTest { 12 | 13 | private ProxyServer proxyServer; 14 | 15 | @After 16 | public void stopServer() throws Exception { 17 | if (proxyServer != null && proxyServer.isRunning()) { 18 | proxyServer.stop().get(); 19 | } 20 | } 21 | 22 | @Test 23 | public void startsAndStopsServer() throws Exception { 24 | proxyServer = new ProxyServer(9090).run().get(); 25 | assertTrue(proxyServer != null); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /performance-tests/images/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/cpu.png -------------------------------------------------------------------------------- /performance-tests/images/netty/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/cpu.png -------------------------------------------------------------------------------- /performance-tests/images/netty/cswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/cswitch.png -------------------------------------------------------------------------------- /performance-tests/images/netty/gc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/gc.png -------------------------------------------------------------------------------- /performance-tests/images/netty/memfree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/memfree.png -------------------------------------------------------------------------------- /performance-tests/images/netty/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/network.png -------------------------------------------------------------------------------- /performance-tests/images/netty/runq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/netty/runq.png -------------------------------------------------------------------------------- /performance-tests/images/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/network.png -------------------------------------------------------------------------------- /performance-tests/images/qlen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/qlen.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/cpu.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/cswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/cswitch.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/gc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/gc.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/memfree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/memfree.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/network.png -------------------------------------------------------------------------------- /performance-tests/images/tomcat/runq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tomcat/runq.png -------------------------------------------------------------------------------- /performance-tests/images/tp50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tp50.png -------------------------------------------------------------------------------- /performance-tests/images/tp75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tp75.png -------------------------------------------------------------------------------- /performance-tests/images/tps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/performance-tests/images/tps.png -------------------------------------------------------------------------------- /performance-tests/performance-ec2.md: -------------------------------------------------------------------------------- 1 | # Performance Testing on EC2 2 | 3 | ### m1.medium Benchmark 4 | This benchmark exists as it's easy to saturate the hardware, surfacing the traits of the implementation. 5 | 6 | Benchmark parameters: 7 | - 10k stub payload, GZIP, 50ms dither. 8 | 9 | #### Vanilla Zuul Result 10 | Latency and CPU increase at ~1300TPS caused by blocking worker threads. See https://github.com/neilbeveridge/Cloud-Prize/blob/master/Submission.md. 11 | 12 | #### Zuul-Netty Result 13 | ``` 14 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 15 | 100 threads and 200 connections 16 | Thread Stats Avg Stdev Max +/- Stdev 17 | Latency 85.09ms 21.84ms 430.58ms 89.66% 18 | Req/Sec 23.36 3.87 41.00 74.48% 19 | 136926 requests in 0.97m, 1.30GB read 20 | Requests/sec: 2360.63 21 | Transfer/sec: 22.96MB 22 | ``` 23 | 24 | ### High Performance Benchmark 25 | The proxy instance type was improved in order to find a point when it would become network-bound, making best use of the resources. ELBs were found to be unreliable in terms of performance and so the proxy implemented an internal randomised load balancer. 26 | 27 | Benchmark parameters: 28 | - 10k stub payload, GZIP, 50ms dither. 29 | - Client: 3 x m1.xl 30 | - Stub: 5 x m3.2xl 31 | - Proxy: 1 x m3.2xl 32 | 33 | I used 3 clients in order not to saturate the network. I wasn't able to saturate the CPU on the proxy – it always had 30% idling. The NIC was saturated on the proxy as it was handling inbound and outbound traffic. The three clients gave the following results – you can see the raised latency caused by network saturation: 34 | 35 | ``` 36 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 37 | 400 threads and 700 connections 38 | Thread Stats Avg Stdev Max +/- Stdev 39 | Latency 139.88ms 113.00ms 1.11s 87.88% 40 | Req/Sec 9.12 3.89 20.00 83.37% 41 | 688494 requests in 3.00m, 6.54GB read 42 | Requests/sec: 3825.85 43 | Transfer/sec: 37.21MB 44 | ``` 45 | ``` 46 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 47 | 400 threads and 700 connections 48 | Thread Stats Avg Stdev Max +/- Stdev 49 | Latency 166.01ms 144.06ms 992.36ms 89.92% 50 | Req/Sec 7.78 3.53 24.00 83.23% 51 | 593650 requests in 3.00m, 5.64GB read 52 | Requests/sec: 3299.71 53 | Transfer/sec: 32.10MB 54 | ``` 55 | ``` 56 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 57 | 400 threads and 700 connections 58 | Thread Stats Avg Stdev Max +/- Stdev 59 | Latency 237.02ms 244.94ms 1.22s 81.00% 60 | Req/Sec 7.73 4.73 27.00 67.53% 61 | 586688 requests in 3.00m, 5.57GB read 62 | Requests/sec: 3259.44 63 | Transfer/sec: 31.71MB 64 | ``` 65 | 66 | If I run the same on only two clients then the proxy idles at 46% and I see the following results at the clients: 67 | 68 | ``` 69 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 70 | 400 threads and 700 connections 71 | Thread Stats Avg Stdev Max +/- Stdev 72 | Latency 83.11ms 18.77ms 567.60ms 98.00% 73 | Req/Sec 11.75 2.23 24.00 82.09% 74 | 879649 requests in 3.00m, 8.36GB read 75 | Requests/sec: 4889.49 76 | Transfer/sec: 47.56MB 77 | ``` 78 | ``` 79 | Running 3m test @ http://---.us-west-1.compute.internal/?length=10000&dither=50 80 | 400 threads and 700 connections 81 | Thread Stats Avg Stdev Max +/- Stdev 82 | Latency 83.64ms 21.74ms 455.94ms 98.15% 83 | Req/Sec 11.78 4.04 26.00 56.82% 84 | 879316 requests in 3.00m, 8.35GB read 85 | Requests/sec: 4885.35 86 | Transfer/sec: 47.52MB 87 | ``` 88 | 89 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.netflix.zuul 8 | zuul-netty 9 | pom 10 | 1.0-SNAPSHOT 11 | 12 | 13 | 3.7.0.Final 14 | 1.7.2 15 | UTF-8 16 | UTF-8 17 | 18 | 19 | 20 | 21 | zuul-core 22 | netty-framework-api 23 | netty-framework-plugins 24 | netty-mock-server 25 | netty-server 26 | zuul-perf-tests 27 | 28 | 29 | 30 | 31 | org.codehaus.groovy 32 | groovy-all 33 | 2.0.2 34 | 35 | 36 | 37 | io.netty 38 | netty 39 | ${netty.version} 40 | 41 | 42 | 43 | org.slf4j 44 | slf4j-api 45 | ${org.slf4j-version} 46 | compile 47 | 48 | 49 | org.slf4j 50 | jcl-over-slf4j 51 | ${org.slf4j-version} 52 | runtime 53 | 54 | 55 | ch.qos.logback 56 | logback-classic 57 | 1.0.9 58 | runtime 59 | 60 | 61 | 62 | org.hamcrest 63 | hamcrest-all 64 | 1.3 65 | test 66 | 67 | 68 | org.slf4j 69 | slf4j-api 70 | 71 | 72 | 73 | 74 | 75 | junit 76 | junit-dep 77 | 4.11 78 | test 79 | 80 | 81 | org.hamcrest 82 | hamcrest-core 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | org.apache.maven.plugins 93 | maven-compiler-plugin 94 | 3.0 95 | 96 | 1.7 97 | 1.7 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /zuul-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | zuul-netty 7 | com.netflix.zuul 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zuul-core 13 | 14 | 15 | 16 | 17 | com.netflix.zuul 18 | netty-framework-api 19 | compile 20 | ${project.version} 21 | 22 | 23 | com.netflix.zuul 24 | netty-framework-plugins 25 | compile 26 | ${project.version} 27 | 28 | 29 | 30 | org.codehaus.groovy 31 | groovy-all 32 | 2.0.2 33 | 34 | 35 | org.mockito 36 | mockito-all 37 | 1.8.5 38 | 39 | 40 | junit 41 | junit-dep 42 | 4.10 43 | 44 | 45 | com.google.collections 46 | google-collections 47 | 1.0 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /zuul-core/src/main/filters-archive/post/Stats.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scripts.postProcess 17 | 18 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 19 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 20 | 21 | /** 22 | * @author Mikey Cohen 23 | * Date: 2/3/12 24 | * Time: 2:48 PM 25 | */ 26 | class Stats extends AbstractZuulPreFilter { 27 | 28 | Stats() { 29 | super("post", 2000) 30 | } 31 | 32 | @Override 33 | boolean shouldFilter(RequestContext requestContext) { 34 | return true 35 | } 36 | 37 | @Override 38 | Void doExecute(RequestContext requestContext) { 39 | dumpRoutingDebug(requestContext) 40 | dumpRequestDebug(requestContext) 41 | } 42 | 43 | public void dumpRequestDebug(RequestContext requestContext) { 44 | List rd = requestContext.get("requestDebug"); 45 | rd?.each { 46 | println("REQUEST_DEBUG::${it}"); 47 | } 48 | } 49 | 50 | public void dumpRoutingDebug(RequestContext requestContext) { 51 | List rd = requestContext.get("routingDebug"); 52 | rd?.each { 53 | println("ZUUL_DEBUG::${it}"); 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /zuul-core/src/main/filters-archive/pre/Debug.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scripts.preProcess 17 | 18 | import com.netflix.config.DynamicBooleanProperty 19 | import com.netflix.config.DynamicPropertyFactory 20 | import com.netflix.config.DynamicStringProperty 21 | import com.netflix.zuul.constants.ZuulConstants 22 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 23 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 24 | 25 | class DebugFilter extends AbstractZuulPreFilter { 26 | 27 | static final DynamicBooleanProperty routingDebug = DynamicPropertyFactory.getInstance().getBooleanProperty(ZuulConstants.ZUUL_DEBUG_REQUEST, true) 28 | static final DynamicStringProperty debugParameter = DynamicPropertyFactory.getInstance().getStringProperty(ZuulConstants.ZUUL_DEBUG_PARAMETER, "d") 29 | 30 | DebugFilter() { 31 | super('pre', 1) 32 | } 33 | 34 | 35 | @Override 36 | boolean shouldFilter(RequestContext requestContext) { 37 | if ("true".equals(requestContext.getRequestParameter(debugParameter.get()))) return true; 38 | return routingDebug.get(); 39 | } 40 | 41 | 42 | @Override 43 | protected Void doExecute(RequestContext requestContext) { 44 | requestContext.setDebugRouting(true) 45 | requestContext.setDebugRequest(true) 46 | } 47 | } 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /zuul-core/src/main/filters-archive/pre/DebugRequest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scripts.preProcess 17 | 18 | import com.netflix.zuul.netty.debug.Debug 19 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 20 | 21 | import io.netty.handler.codec.http.HttpRequest 22 | 23 | /** 24 | * @author Mikey Cohen 25 | * Date: 3/12/12 26 | * Time: 1:51 PM 27 | */ 28 | class DebugRequest extends AbstractZuulPreFilter { 29 | DebugRequest() { 30 | super('pre', 10000) 31 | } 32 | 33 | @Override 34 | boolean shouldFilter(RequestContext requestContext) { 35 | return requestContext.debugRequest 36 | } 37 | 38 | @Override 39 | Void doExecute(RequestContext requestContext) { 40 | HttpRequest req = requestContext.getRequest() 41 | Debug.addRequestDebug(requestContext, "REQUEST:: > " + req.method + " " + req.uri + " " + req.protocolVersion) 42 | 43 | req.headers().each { 44 | Debug.addRequestDebug(requestContext, "REQUEST:: > ${it}") 45 | } 46 | return null 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /zuul-core/src/main/filters-archive/pre/PreDecoration.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | import com.netflix.zuul.netty.debug.Debug 19 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 20 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 21 | 22 | /** 23 | * @author mhawthorne 24 | */ 25 | class PreDecorationFilter extends AbstractZuulPreFilter { 26 | 27 | PreDecorationFilter() { 28 | super('pre', 5) 29 | } 30 | 31 | @Override 32 | Void doExecute(RequestContext requestContext) { 33 | // sets origin 34 | Debug.addRequestDebug(requestContext, "SETTING ROUTE HOST :: > http://apache.org/") 35 | requestContext.setRouteHost(new URL("http://apache.org/")); 36 | // sets custom header to send to the origin 37 | requestContext.addOriginResponseHeader("cache-control", "max-age=3600"); 38 | 39 | return null 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /zuul-core/src/main/filters/pre/PreDecoration.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 19 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest 20 | import com.netflix.zuul.proxy.framework.api.Route 21 | 22 | import java.util.concurrent.ThreadLocalRandom 23 | 24 | 25 | /** 26 | * @author mhawthorne 27 | */ 28 | class PreDecorationFilter extends AbstractZuulPreFilter { 29 | 30 | private static final String[] HOSTS = [ 31 | "http://www.google.com:80" 32 | ] 33 | 34 | PreDecorationFilter() { 35 | super(5) 36 | } 37 | 38 | @Override 39 | void requestReceived(FrameworkHttpRequest request) { 40 | String host = HOSTS[ThreadLocalRandom.current().nextInt(HOSTS.length)]; 41 | request.addHeader(Route.ROUTE_HEADER, host); 42 | request.addHeader("Host", host); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/DynamicCodeCompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.zuul.netty; 18 | 19 | import java.io.File; 20 | 21 | 22 | /** 23 | * Interface to generate Classes from source code 24 | * User: mcohen 25 | * Date: 5/30/13 26 | * Time: 11:35 AM 27 | */ 28 | public interface DynamicCodeCompiler { 29 | Class compile(String sCode, String sName) throws Exception; 30 | 31 | Class compile(File file) throws Exception; 32 | } -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/debug/Debug.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.debug; 2 | 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | /** 8 | * @author HWEB 9 | */ 10 | public class Debug { 11 | 12 | // public static void setDebugRequest(RequestContext currentContext, boolean bDebug) { 13 | // currentContext.setDebugRequest(bDebug); 14 | // } 15 | // 16 | // public static void setDebugRequestHeadersOnly(RequestContext currentContext, boolean bHeadersOnly) { 17 | // currentContext.setDebugRequestHeadersOnly(bHeadersOnly); 18 | // } 19 | // 20 | // public static boolean debugRequestHeadersOnly(RequestContext currentContext) { 21 | // return currentContext.debugRequestHeadersOnly(); 22 | // } 23 | // 24 | // 25 | // public static void setDebugRouting(RequestContext currentContext, boolean bDebug) { 26 | // currentContext.setDebugRouting(bDebug); 27 | // } 28 | // 29 | // 30 | // public static boolean debugRequest(RequestContext currentContext) { 31 | // return currentContext.debugRequest(); 32 | // } 33 | // 34 | // public static boolean debugRouting(RequestContext currentContext) { 35 | // return currentContext.debugRouting(); 36 | // } 37 | // 38 | // public static void addRoutingDebug(RequestContext currentContext, String line) { 39 | // List rd = getRoutingDebug(currentContext); 40 | // rd.add(line); 41 | // } 42 | // 43 | // /** 44 | // * @return Returns the list of routiong debug messages 45 | // */ 46 | // public static List getRoutingDebug(RequestContext currentContext) { 47 | // List rd = (List) currentContext.get("routingDebug"); 48 | // if (rd == null) { 49 | // rd = new ArrayList<>(); 50 | // currentContext.set("routingDebug", rd); 51 | // } 52 | // return rd; 53 | // } 54 | // 55 | // /** 56 | // * Adds a line to the Request debug messages 57 | // * 58 | // * @param line 59 | // */ 60 | // public static void addRequestDebug(RequestContext currentContext, String line) { 61 | // List rd = getRequestDebug(currentContext); 62 | // rd.add(line); 63 | // } 64 | // 65 | // /** 66 | // * @return returns the list of request debug messages 67 | // */ 68 | // public static List getRequestDebug(RequestContext currentContext) { 69 | // List rd = (List) currentContext.get("requestDebug"); 70 | // if (rd == null) { 71 | // rd = new ArrayList<>(); 72 | // currentContext.set("requestDebug", rd); 73 | // } 74 | // return rd; 75 | // } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/AbstractZuulPostFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpResponse; 5 | 6 | /** 7 | * @author HWEB 8 | */ 9 | public abstract class AbstractZuulPostFilter implements ZuulPostFilter { 10 | 11 | private final String type; 12 | private final int order; 13 | 14 | public AbstractZuulPostFilter(String type, int order) { 15 | this.type = type; 16 | this.order = order; 17 | } 18 | 19 | @Override 20 | public String type() { 21 | return type; 22 | } 23 | 24 | @Override 25 | public int order() { 26 | return order; 27 | } 28 | 29 | @Override 30 | public boolean shouldFilter(FrameworkHttpRequest request, FrameworkHttpResponse response) { 31 | return true; 32 | } 33 | 34 | @Override 35 | public int compareTo(ZuulFilter o) { 36 | return order - o.order(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/AbstractZuulPreFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | 5 | /** 6 | * @author HWEB 7 | */ 8 | public abstract class AbstractZuulPreFilter implements ZuulPreFilter { 9 | 10 | private final String type = "pre"; 11 | private final int order; 12 | 13 | public AbstractZuulPreFilter(int order) { 14 | this.order = order; 15 | } 16 | 17 | @Override 18 | public String type() { 19 | return type; 20 | } 21 | 22 | @Override 23 | public int order() { 24 | return order; 25 | } 26 | 27 | @Override 28 | public boolean shouldFilter(FrameworkHttpRequest request) { 29 | return true; 30 | } 31 | 32 | @Override 33 | public int compareTo(ZuulFilter o) { 34 | return order - o.order(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/FiltersChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import java.nio.file.Path; 4 | import java.util.EventListener; 5 | 6 | /** 7 | * @author HWEB 8 | */ 9 | public interface FiltersChangeListener extends EventListener { 10 | 11 | void filterAdded(Path filterPah); 12 | 13 | void filterRemoved(Path filterPah); 14 | 15 | void filterChanged(Path filterPah); 16 | } 17 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/FiltersChangeNotifier.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | /** 4 | * @author HWEB 5 | */ 6 | public interface FiltersChangeNotifier { 7 | 8 | FiltersChangeNotifier IGNORE = new FiltersChangeNotifier() { 9 | @Override 10 | public void addFiltersListener(FiltersListener filtersListener) { 11 | } 12 | }; 13 | 14 | void addFiltersListener(FiltersListener filtersListener); 15 | } 16 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/FiltersListener.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import java.nio.file.Path; 4 | import java.util.EventListener; 5 | 6 | /** 7 | * @author HWEB 8 | */ 9 | public interface FiltersListener extends EventListener { 10 | 11 | /** 12 | * @param filterPath 13 | * @param filter 14 | */ 15 | void filterAdded(Path filterPath, ZuulFilter filter); 16 | 17 | 18 | /** 19 | * 20 | * @param filterPath 21 | * @param filter 22 | */ 23 | void filterRemoved(Path filterPath, ZuulFilter filter); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/Ordered.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | /** 4 | * @author HWEB 5 | */ 6 | public interface Ordered { 7 | int order(); 8 | } 9 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | /** 4 | */ 5 | public interface ZuulFilter extends Ordered, Comparable { 6 | 7 | /** 8 | * @return 9 | */ 10 | String type(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFiltersLoader.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import com.netflix.zuul.netty.DynamicCodeCompiler; 4 | import com.netflix.zuul.netty.groovy.GroovyCompiler; 5 | import com.netflix.zuul.netty.util.Announcer; 6 | 7 | import java.io.File; 8 | import java.lang.reflect.Modifier; 9 | import java.nio.file.Path; 10 | import java.util.List; 11 | 12 | import static com.google.common.collect.Lists.newArrayList; 13 | 14 | /** 15 | * @author HWEB 16 | */ 17 | public class ZuulFiltersLoader implements FiltersChangeNotifier { 18 | 19 | private final Announcer announcer = Announcer.to(FiltersListener.class); 20 | 21 | public static final DynamicCodeCompiler COMPILER = new GroovyCompiler(); 22 | private final Path filtersRootPath; 23 | 24 | public ZuulFiltersLoader(Path filtersRootPath) { 25 | this.filtersRootPath = filtersRootPath; 26 | } 27 | 28 | private void registerPreFilters() { 29 | if (filtersRootPath.toFile().exists()) { 30 | for (File src : readZuulFiltersFrom(filtersRootPath)) { 31 | filterAdded(src.toPath()); 32 | } 33 | } 34 | } 35 | 36 | private static List readZuulFiltersFrom(Path path) { 37 | List files = newArrayList(); 38 | for (File file : path.toFile().listFiles()) { 39 | if (file.getName().endsWith(".groovy")) { 40 | files.add(file); 41 | } 42 | if (file.isDirectory()) { 43 | files.addAll(readZuulFiltersFrom(file.toPath())); 44 | } 45 | } 46 | return files; 47 | } 48 | 49 | private ZuulFilter parseFilter(File file) throws Exception { 50 | Class clazz = COMPILER.compile(file); 51 | if (!Modifier.isAbstract(clazz.getModifiers())) { 52 | ZuulFilter zuulFilter = (ZuulFilter) clazz.newInstance(); 53 | return zuulFilter; 54 | } 55 | 56 | return null; 57 | } 58 | 59 | 60 | public void filterAdded(Path filterPah) { 61 | updateFilters(filterPah); 62 | } 63 | 64 | private void updateFilters(Path filterPah) { 65 | try { 66 | announcer.announce().filterAdded(filterPah, parseFilter(filterPah.toFile())); 67 | } catch (Exception e) { 68 | 69 | } 70 | } 71 | 72 | @Override 73 | public void addFiltersListener(FiltersListener filtersListener) { 74 | announcer.addListener(filtersListener); 75 | } 76 | 77 | public void reload() { 78 | registerPreFilters(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulPostFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpResponse; 5 | import com.netflix.zuul.proxy.framework.api.HttpResponseHandler; 6 | 7 | /** 8 | * Created with IntelliJ IDEA. 9 | * User: root 10 | * Date: 9/13/13 11 | * Time: 1:02 PM 12 | * To change this template use File | Settings | File Templates. 13 | */ 14 | public interface ZuulPostFilter extends ZuulFilter, HttpResponseHandler { 15 | 16 | boolean shouldFilter(FrameworkHttpRequest request, FrameworkHttpResponse response); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulPreFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest; 4 | import com.netflix.zuul.proxy.framework.api.HttpRequestHandler; 5 | 6 | /** 7 | * Created with IntelliJ IDEA. 8 | * User: root 9 | * Date: 9/13/13 10 | * Time: 1:02 PM 11 | * To change this template use File | Settings | File Templates. 12 | */ 13 | public interface ZuulPreFilter extends ZuulFilter, HttpRequestHandler { 14 | 15 | boolean shouldFilter (FrameworkHttpRequest request); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/groovy/GroovyCompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.netflix.zuul.netty.groovy; 18 | 19 | import com.netflix.zuul.netty.DynamicCodeCompiler; 20 | import groovy.lang.GroovyClassLoader; 21 | import groovy.lang.GroovyObject; 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | import org.mockito.runners.MockitoJUnitRunner; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.io.File; 29 | import java.io.IOException; 30 | 31 | import static org.junit.Assert.*; 32 | import static org.mockito.Mockito.spy; 33 | 34 | /** 35 | * Groovy code compiler 36 | * User: mcohen 37 | * Date: 5/30/13 38 | * Time: 11:38 AM 39 | * To change this template use File | Settings | File Templates. 40 | */ 41 | public class GroovyCompiler implements DynamicCodeCompiler { 42 | 43 | private static final Logger LOG = LoggerFactory.getLogger(GroovyCompiler.class); 44 | 45 | /** 46 | * Compiles Groovy code and returns the Class of the compiles code. 47 | * 48 | * @param sCode 49 | * @param sName 50 | * @return 51 | */ 52 | public Class compile(String sCode, String sName) { 53 | GroovyClassLoader loader = getGroovyClassLoader(); 54 | LOG.warn("Compiling filter: " + sName); 55 | Class groovyClass = loader.parseClass(sCode, sName); 56 | return groovyClass; 57 | } 58 | 59 | /** 60 | * @return a new GroovyClassLoader 61 | */ 62 | GroovyClassLoader getGroovyClassLoader() { 63 | return new GroovyClassLoader(); 64 | } 65 | 66 | /** 67 | * Compiles groovy class from a file 68 | * 69 | * @param file 70 | * @return 71 | * @throws java.io.IOException 72 | */ 73 | public Class compile(File file) throws IOException { 74 | GroovyClassLoader loader = getGroovyClassLoader(); 75 | Class groovyClass = loader.parseClass(file); 76 | return groovyClass; 77 | } 78 | 79 | @RunWith(MockitoJUnitRunner.class) 80 | public static class UnitTest { 81 | @Test 82 | public void testLoadGroovyFromString() { 83 | 84 | GroovyCompiler compiler = spy(new GroovyCompiler()); 85 | 86 | try { 87 | 88 | String code = "class test { public String hello(){return \"hello\" } } "; 89 | Class clazz = compiler.compile(code, "test"); 90 | assertNotNull(clazz); 91 | assertEquals(clazz.getName(), "test"); 92 | GroovyObject groovyObject = (GroovyObject) clazz.newInstance(); 93 | Object[] args = {}; 94 | String s = (String) groovyObject.invokeMethod("hello", args); 95 | assertEquals(s, "hello"); 96 | 97 | 98 | } catch (Exception e) { 99 | assertFalse(true); 100 | } 101 | 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/groovy/GroovyFileFilter.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.groovy; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: mcohen 6 | * Date: 5/30/13 7 | * Time: 11:47 AM 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | 11 | import org.junit.Before; 12 | import org.junit.Test; 13 | import org.junit.runner.RunWith; 14 | import org.mockito.Mock; 15 | import org.mockito.MockitoAnnotations; 16 | import org.mockito.runners.MockitoJUnitRunner; 17 | 18 | import java.io.File; 19 | import java.io.FilenameFilter; 20 | 21 | import static org.junit.Assert.assertFalse; 22 | import static org.junit.Assert.assertTrue; 23 | import static org.mockito.Mockito.when; 24 | 25 | /** 26 | * Filters only .groovy files 27 | */ 28 | public class GroovyFileFilter implements FilenameFilter { 29 | public boolean accept(File dir, String name) { 30 | return name.endsWith(".groovy"); 31 | } 32 | 33 | 34 | @RunWith(MockitoJUnitRunner.class) 35 | public static class UnitTest { 36 | 37 | @Mock 38 | private File nonGroovyFile; 39 | @Mock 40 | private File groovyFile; 41 | 42 | @Mock 43 | private File directory; 44 | 45 | @Before 46 | public void before() { 47 | MockitoAnnotations.initMocks(this); 48 | } 49 | 50 | 51 | @Test 52 | public void testGroovyFileFilter() { 53 | 54 | when(nonGroovyFile.getName()).thenReturn("file.mikey"); 55 | when(groovyFile.getName()).thenReturn("file.groovy"); 56 | 57 | GroovyFileFilter filter = new GroovyFileFilter(); 58 | 59 | assertFalse(filter.accept(nonGroovyFile, "file.mikey")); 60 | assertTrue(filter.accept(groovyFile, "file.groovy")); 61 | 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /zuul-core/src/main/java/com/netflix/zuul/netty/util/Announcer.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.util; 2 | 3 | import java.lang.reflect.InvocationHandler; 4 | import java.lang.reflect.InvocationTargetException; 5 | import java.lang.reflect.Method; 6 | import java.lang.reflect.Proxy; 7 | import java.util.ArrayList; 8 | import java.util.EventListener; 9 | import java.util.List; 10 | 11 | public class Announcer { 12 | private final T proxy; 13 | private final List listeners = new ArrayList(); 14 | 15 | 16 | public Announcer(Class listenerType) { 17 | proxy = listenerType.cast(Proxy.newProxyInstance( 18 | listenerType.getClassLoader(), 19 | new Class[]{listenerType}, 20 | new InvocationHandler() { 21 | public Object invoke(Object aProxy, Method method, Object[] args) throws Throwable { 22 | announce(method, args); 23 | return null; 24 | } 25 | })); 26 | } 27 | 28 | public void addListener(T listener) { 29 | listeners.add(listener); 30 | } 31 | 32 | public void removeListener(T listener) { 33 | listeners.remove(listener); 34 | } 35 | 36 | public T announce() { 37 | return proxy; 38 | } 39 | 40 | private void announce(Method m, Object[] args) { 41 | try { 42 | for (T listener : listeners) { 43 | m.invoke(listener, args); 44 | } 45 | } catch (IllegalAccessException e) { 46 | throw new IllegalArgumentException("could not invoke listener", e); 47 | } catch (InvocationTargetException e) { 48 | Throwable cause = e.getCause(); 49 | 50 | if (cause instanceof RuntimeException) { 51 | throw (RuntimeException) cause; 52 | } else if (cause instanceof Error) { 53 | throw (Error) cause; 54 | } else { 55 | throw new UnsupportedOperationException("listener threw exception", cause); 56 | } 57 | } 58 | } 59 | 60 | public static Announcer to(Class listenerType) { 61 | return new Announcer(listenerType); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /zuul-core/src/test/java/com/netflix/zuul/netty/ZuulRunnerTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * @author HWEB 7 | */ 8 | public class ZuulRunnerTest { 9 | 10 | // public static final Path FILTERS_ROOT_PATH = Paths.get(ZuulServerTest.class.getResource("/filters").getFile()); 11 | // 12 | // final ZuulRunner runner = new ZuulRunner(FILTERS_ROOT_PATH); 13 | 14 | @Test 15 | public void compilesGroovyFilter() throws Exception { 16 | // ZuulFilter zuulFilter = runner.parseFilter(FILTERS_ROOT_PATH.resolve("pre/DebugFilter.groovy").toFile()); 17 | // 18 | // assertThat(zuulFilter.type(), is("pre")); 19 | // assertThat(zuulFilter.order(), is(1)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /zuul-core/src/test/java/com/netflix/zuul/netty/ZuulServerTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty; 2 | 3 | /** 4 | * @author HWEB 5 | */ 6 | public class ZuulServerTest { 7 | 8 | 9 | // private ZuulServer server; 10 | // 11 | // 12 | // @After 13 | // public void stopServer() throws Exception { 14 | // if (server != null && server.isRunning()) { 15 | // server.stop().get(); 16 | // } 17 | // } 18 | // 19 | // @Test 20 | // public void startAndStopServer() throws Exception { 21 | // server = new ZuulServer(9090); 22 | // startServerInBackground(); 23 | // assertTrue("Server should be running", server.isRunning()); 24 | // } 25 | // 26 | // 27 | // @Test 28 | // public void executesZuulFilters() throws Exception { 29 | // ZuulRunner handler = new ZuulRunner(); 30 | // ZuulFilter debugFilter = mock(ZuulFilter.class); 31 | // handler.filterAdded(Paths.get("debug-filter"), debugFilter); 32 | // server = new ZuulServer(9090) 33 | // .add(handler); 34 | // startServerInBackground(); 35 | // 36 | // get(URI.create("http://localhost:9090")); 37 | // verify(debugFilter).execute(any(RequestContext.class)); 38 | // 39 | // } 40 | // 41 | // @Test 42 | // public void executesNewlyAddedFilter() throws Exception { 43 | // ZuulRunner zuulRunner = new ZuulRunner(); 44 | // server = new ZuulServer(9090) 45 | // .add(zuulRunner); 46 | // startServerInBackground(); 47 | // 48 | // get(URI.create("http://localhost:9090")); 49 | // 50 | // ZuulFilter newFilter = mock(ZuulFilter.class); 51 | // zuulRunner.filterAdded(Paths.get("new-filter"), newFilter); 52 | // get(URI.create("http://localhost:9090")); 53 | // 54 | // verify(newFilter).execute(any(RequestContext.class)); 55 | // 56 | // } 57 | // 58 | // @Test 59 | // public void willNotExecuteRemovedFilters() throws Exception { 60 | // ZuulRunner zuulRunner = new ZuulRunner(); 61 | // ZuulFilter filter = mock(ZuulFilter.class); 62 | // Path filterPath = Paths.get("filter"); 63 | // zuulRunner.filterAdded(filterPath, filter); 64 | // server = new ZuulServer(9090) 65 | // .add(zuulRunner); 66 | // startServerInBackground(); 67 | // get(URI.create("http://localhost:9090")); 68 | // zuulRunner.filterRemoved(filterPath, filter); 69 | // get(URI.create("http://localhost:9090")); 70 | // 71 | // verify(filter, times(1)).execute(any(RequestContext.class)); 72 | // 73 | // } 74 | // 75 | // 76 | // public void get(URI uri) throws IOException { 77 | // HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection(); 78 | // connection.setRequestProperty("Accept-Charset", Charsets.UTF_8.name()); 79 | // try { 80 | // connection.getInputStream(); 81 | // } finally { 82 | // connection.disconnect(); 83 | // } 84 | // } 85 | // 86 | // private void startServerInBackground() throws InterruptedException { 87 | // FutureTask future = new FutureTask<>(new Callable() { 88 | // @Override 89 | // public ZuulServer call() throws Exception { 90 | // return server.start(); 91 | // } 92 | // }); 93 | // Executors.newSingleThreadExecutor().execute(future); 94 | // Thread.sleep(1000); 95 | // } 96 | 97 | 98 | } 99 | -------------------------------------------------------------------------------- /zuul-core/src/test/java/com/netflix/zuul/netty/filter/ZuulFiltersLoaderTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.zuul.netty.filter; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | import java.nio.file.Path; 7 | import java.nio.file.Paths; 8 | 9 | import static org.mockito.Matchers.any; 10 | import static org.mockito.Mockito.mock; 11 | import static org.mockito.Mockito.verify; 12 | 13 | /** 14 | * @author HWEB 15 | */ 16 | public class ZuulFiltersLoaderTest { 17 | 18 | public static final Path FILTERS_ROOT_PATH = Paths.get(ZuulFiltersLoaderTest.class.getResource("/filters").getFile()); 19 | 20 | @Test 21 | @Ignore 22 | public void notifiesListenersOfNewFilters() throws Exception { 23 | ZuulFiltersLoader zuulFiltersLoader = new ZuulFiltersLoader(FILTERS_ROOT_PATH); 24 | FiltersListener filtersListener = mock(FiltersListener.class); 25 | zuulFiltersLoader.addFiltersListener(filtersListener); 26 | 27 | zuulFiltersLoader.reload(); 28 | 29 | verify(filtersListener).filterAdded(any(Path.class), any(ZuulFilter.class)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /zuul-perf-tests/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /zuul-perf-tests/src/test/java/EndToEndTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | 3 | import java.net.HttpURLConnection; 4 | import java.net.URL; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | /** 9 | * @author HWEB 10 | */ 11 | public class EndToEndTest { 12 | 13 | @Test 14 | public void testCall() throws Exception { 15 | String responseBody = sendRequest("http://localhost:9091"); 16 | assertEquals("OK", responseBody); 17 | } 18 | 19 | public String sendRequest(final String uri) throws Exception { 20 | URL url = new URL(uri.toString()); 21 | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 22 | return connection.getResponseMessage(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /zuul-perf-tests/src/test/resources/filters/pre/PreDecoration.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | 19 | import com.netflix.zuul.netty.filter.AbstractZuulPreFilter 20 | import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest 21 | import com.netflix.zuul.proxy.framework.api.Route 22 | /** 23 | * @author mhawthorne 24 | */ 25 | class PreDecorationFilter extends AbstractZuulPreFilter { 26 | 27 | PreDecorationFilter() { 28 | super(5) 29 | } 30 | 31 | @Override 32 | void requestReceived(FrameworkHttpRequest request) { 33 | request.addHeader(Route.ROUTE_HEADER, "http://localhost:8081"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /zuul-perf-tests/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/LICENSE -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/NOTICE: -------------------------------------------------------------------------------- 1 | Apache JMeter 2 | Copyright 1998-2013 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | This product includes JavaScript support provided by the Mozilla Rhino project 8 | See https://developer.mozilla.org/en-US/docs/Rhino 9 | 10 | This product includes software developed by the 11 | JDOM Project (http://www.jdom.org/). 12 | 13 | This product includes JUnit (http://www.junit.org/) 14 | under the Common Public License Version 1.0: http://www.opensource.org/licenses/cpl.php 15 | 16 | This product includes XStream (http://xstream.codehaus.org/) 17 | Copyright (c) 2003-2004, Joe Walnes All rights reserved. 18 | 19 | This product includes software developed by the Indiana University 20 | Extreme! Lab (http://www.extreme.indiana.edu/). (XPP3 Pull Parser) 21 | 22 | This project includes HTMLParser (http://htmlparser.sourceforge.net/) 23 | under the Common Public License Version 1.0: http://www.opensource.org/licenses/cpl.php 24 | 25 | This product includes software developed by the jCharts Project. 26 | See http://jcharts.sourceforge.net/ 27 | 28 | This product includes BeanShell by Pat Niemeyer 29 | http://www.beanshell.org/; Source: http://www.beanshell.org/developer.html 30 | 31 | This product includes JAF and JavaMail from Oracle(Sun) 32 | The software is included under the CDDL License. 33 | 34 | This product includes JODD (http://jodd.org/) 35 | The software is included under the BSD License. 36 | 37 | This product includes JSOUP (http://jsoup.org/) 38 | The software is included under the MIT License. 39 | 40 | The product includes icons from Open Icon Library 41 | http://openiconlibrary.sourceforge.net/, of which the 42 | Oxygen Icons 4.3.1 are added under the CC-BY-SA 3.0 license 43 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/ApacheJMeter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/bin/ApacheJMeter.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/BeanShellAssertion.bshrc: -------------------------------------------------------------------------------- 1 | // Sample BeanShell Assertion initialisation file 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | //print("Initialisation started"); 22 | 23 | import org.apache.jmeter.util.JMeterUtils; 24 | 25 | i = j = k = 0; // for counters 26 | 27 | getprop(p){// get a JMeter property 28 | return JMeterUtils.getPropDefault(p,""); 29 | } 30 | 31 | getprop(p,d){// get a JMeter property with default 32 | return JMeterUtils.getPropDefault(p,d); 33 | } 34 | 35 | setprop(p,v){// set a JMeter property 36 | JMeterUtils.setProperty(p, v); 37 | } 38 | 39 | // Assertions can use the following methods on the Response object: 40 | // SampleResult.setStopThread(true) 41 | // SampleResult.setStopTest(true) 42 | 43 | //print("Initialisation complete"); 44 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/BeanShellFunction.bshrc: -------------------------------------------------------------------------------- 1 | // Sample BeanShell Function initialisation file 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | // N.B. to enable this file to be used, define the JMeter property: 22 | // beanshell.function.init=BeanShellFunction.bshrc 23 | 24 | //print("Initialisation started"); 25 | 26 | import org.apache.jmeter.util.JMeterUtils; 27 | 28 | i = j = k = 0; // for counters 29 | 30 | getprop(p){// get a JMeter property 31 | return JMeterUtils.getPropDefault(p,""); 32 | } 33 | 34 | getprop(p,d){// get a JMeter property with default 35 | return JMeterUtils.getPropDefault(p,d); 36 | } 37 | 38 | setprop(p,v){// set a JMeter property 39 | JMeterUtils.setProperty(p, v); 40 | } 41 | 42 | // Define routines to stop the test or the current thread 43 | stopTest(){// Stop the JMeter test 44 | org.apache.jmeter.engine.StandardJMeterEngine.stopEngine(); 45 | } 46 | 47 | stopThread(){// Stop current JMeter thread 48 | org.apache.jmeter.engine.StandardJMeterEngine.stopThread(Thread.currentThread().getName()); 49 | } 50 | 51 | // Fix ampersands in a string 52 | // e.g. fixAmps("Something containing & ...") 53 | // or fixAmps(vars.get("VARNAME")) - useful if VARNAME may contain " 54 | String fixAmps(s) { 55 | return s.replaceAll("&","&"); 56 | } 57 | 58 | // Fix ampersands in a variable 59 | // e.g. fixAmps("VARNAME") 60 | String fixAmpsInVar(String varname) { 61 | return fixAmps(vars.get(varname)); 62 | } 63 | 64 | //print("Initialisation complete"); 65 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/BeanShellListeners.bshrc: -------------------------------------------------------------------------------- 1 | // Example BeanShell Listener definitions 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | // ThreadListener methods 22 | 23 | threadStarted(){ 24 | print("threadStarted"); 25 | } 26 | 27 | threadFinished(){ 28 | print("threadFinished"); 29 | } 30 | 31 | // TestListener methods 32 | 33 | testStarted(){ 34 | print("testStarted"); 35 | } 36 | 37 | testEnded(){ 38 | print("testEnded"); 39 | } 40 | 41 | testStarted(String s){ 42 | print("testStarted "+s); 43 | } 44 | 45 | testEnded(String s){ 46 | print("testEnded "+s); 47 | } -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/BeanShellSampler.bshrc: -------------------------------------------------------------------------------- 1 | // Sample BeanShell Sampler initialisation file 2 | // To enable, define the JMeter property: 3 | // beanshell.sampler.init=BeanShellSampler.bshrc 4 | 5 | /* 6 | * Licensed to the Apache Software Foundation (ASF) under one or more 7 | * contributor license agreements. See the NOTICE file distributed with 8 | * this work for additional information regarding copyright ownership. 9 | * The ASF licenses this file to You under the Apache License, Version 2.0 10 | * (the "License"); you may not use this file except in compliance with 11 | * the License. You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | //print("Initialisation started"); 24 | 25 | import org.apache.jmeter.util.JMeterUtils; 26 | 27 | i = j = k = 0; // for counters 28 | 29 | getprop(p){// get a JMeter property 30 | return JMeterUtils.getPropDefault(p,""); 31 | } 32 | 33 | getprop(p,d){// get a JMeter property with default 34 | return JMeterUtils.getPropDefault(p,d); 35 | } 36 | 37 | setprop(p,v){// set a JMeter property 38 | JMeterUtils.setProperty(p, v); 39 | } 40 | 41 | // Define routines to stop the test or a thread 42 | stopEngine(){// Stop the JMeter test 43 | org.apache.jmeter.engine.StandardJMeterEngine.stopEngine(); 44 | } 45 | 46 | stopThread(t){// Stop a JMeter thread 47 | org.apache.jmeter.engine.StandardJMeterEngine.stopThread(t); 48 | } 49 | 50 | String getVariables(){ // Create a listing of the thread variables 51 | StringBuffer sb = new StringBuffer(100); 52 | Iterator i = vars.getIterator(); 53 | while(i.hasNext()) 54 | { 55 | Map.Entry me = i.next(); 56 | if(String.class.equals(me.getValue().getClass())){ 57 | sb.append(me.toString()).append("\n"); 58 | } 59 | } 60 | return sb.toString(); 61 | } 62 | 63 | // Interruptible interface 64 | 65 | interrupt() { 66 | print("Interrupt detected"); 67 | } 68 | 69 | //print("Initialisation complete"); 70 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/examples/CSVSample_actions.csv: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | d -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/examples/CSVSample_user.csv: -------------------------------------------------------------------------------- 1 | u1,p1 2 | u2,p2 -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/examples/jsp/memory.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false" contentType="text/html" buffer="8kb" %> 2 | 18 | 19 | 20 | textToTExtract 21 |
    22 |
  • textToTExtract2
  • 23 |
24 |

zadadadzdadd

25 | textToTExtract3 26 | <% 27 | int size = Integer.parseInt(request.getParameter("size")); 28 | for (int i=0;i 30 |

abcdefghijklmno<%=System.currentTimeMillis() %>

31 | <% 32 | } 33 | %> 34 | 35 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/hc.parameters: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Properties file used to define additional default Apache HttpClient parameters 17 | # 18 | # 19 | # This file is enabled by setting the JMeter property: hc.parameters.file 20 | # entries are of the form: 21 | # 22 | # property=value (for strings) 23 | # property$Type=value (for other types) 24 | # 25 | # where Type can be: 26 | # Integer 27 | # Long 28 | # Boolean 29 | # HttpVersion 30 | # 31 | # N.B. Other types are not yet implemented 32 | # 33 | 34 | # Examples: 35 | 36 | #http.protocol.version$HttpVersion=1.0 37 | 38 | #http.protocol.element-charset=ISO-8859-1 39 | 40 | #http.socket.timeout$Integer=10000 41 | 42 | #http.protocol.reject-relative-redirect$Boolean=true 43 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/heapdump.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem Ask the JMeter client to perform a HeapDump 19 | 20 | rem P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | java -cp %~dp0ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient HeapDump %* 23 | pause -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/heapdump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | # Ask the JMeter client to perform a HeapDump 19 | 20 | # P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | DIRNAME=`dirname $0` 23 | 24 | java -cp ${DIRNAME}/ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient HeapDump "$@" 25 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/httpclient.parameters: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Properties file used to define additional default Commons HttpClient parameters 17 | # 18 | # See: http://hc.apache.org/httpclient-3.x/preference-api.html 19 | # 20 | # This file is enabled by setting the JMeter property: httpclient.parameters.file 21 | # entries are of the form: 22 | # 23 | # property=value (for strings) 24 | # property$Type=value (for other types) 25 | # 26 | # where Type can be: 27 | # Integer 28 | # Long 29 | # Boolean 30 | # HttpVersion 31 | # 32 | # N.B. Other types are not yet implemented, so not all parameters are supported 33 | # 34 | 35 | # Examples: 36 | 37 | #http.protocol.version$HttpVersion=1.0 38 | 39 | #http.protocol.element-charset=ISO-8859-1 40 | 41 | #http.socket.timeout$Integer=10000 42 | 43 | #http.protocol.reject-relative-redirect$Boolean=true 44 | 45 | #http.authentication.preemptive$Boolean=true -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-n-r.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem ============================================ 19 | rem Non-GUI version of JMETER.BAT (WinNT/2K only) 20 | rem 21 | rem Drop a JMX file on this batch script, and it 22 | rem will run it in non-GUI mode, with a log file 23 | rem formed from the input file name but with the 24 | rem extension .jtl 25 | rem 26 | rem Only the first parameter is used. 27 | rem Only works for Win2k. 28 | rem 29 | rem ============================================ 30 | 31 | if "%OS%"=="Windows_NT" goto WinNT 32 | echo "Sorry, this command file requires Windows NT/ 2000 / XP" 33 | pause 34 | goto END 35 | :WinNT 36 | 37 | rem Check file is supplied 38 | if a == a%1 goto winNT2 39 | 40 | rem Allow special name LAST 41 | if LAST == %1 goto winNT3 42 | 43 | rem Check it has extension .jmx 44 | if "%~x1" == ".jmx" goto winNT3 45 | :winNT2 46 | echo Please supply a script name with the extension .jmx 47 | pause 48 | goto END 49 | :winNT3 50 | 51 | rem Change to script directory 52 | pushd %~dp1 53 | 54 | rem use same directory to find jmeter script 55 | call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl" -r %2 %3 %4 %5 %6 %7 %8 %9 56 | 57 | popd 58 | 59 | :END -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-n.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem ============================================ 19 | rem Non-GUI version of JMETER.BAT (WinNT/2K only) 20 | rem 21 | rem Drop a JMX file on this batch script, and it 22 | rem will run it in non-GUI mode, with a log file 23 | rem formed from the input file name but with the 24 | rem extension .jtl 25 | rem 26 | rem Only the first parameter is used. 27 | rem Only works for Win2k. 28 | rem 29 | rem ============================================ 30 | 31 | if "%OS%"=="Windows_NT" goto WinNT 32 | echo "Sorry, this command file requires Windows NT/ 2000 / XP" 33 | pause 34 | goto END 35 | :WinNT 36 | 37 | rem Check file is supplied 38 | if a == a%1 goto winNT2 39 | 40 | rem Allow special name LAST 41 | if LAST == %1 goto winNT3 42 | 43 | rem Check it has extension .jmx 44 | if "%~x1" == ".jmx" goto winNT3 45 | :winNT2 46 | echo Please supply a script name with the extension .jmx 47 | pause 48 | goto END 49 | :winNT3 50 | 51 | rem Change to script directory 52 | pushd %~dp1 53 | 54 | rem use same directory to find jmeter script 55 | call "%~dp0"jmeter -n -t "%~nx1" -j "%~n1.log" -l "%~n1.jtl" %2 %3 %4 %5 %6 %7 %8 %9 56 | 57 | popd 58 | 59 | :END -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-report: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | # The following should be reasonably good values for most tests running 19 | # on Sun JVMs. Following is the analysis on which it is based. If it's total 20 | # gibberish to you, please study my article at 21 | # http://www.atg.com/portal/myatg/developer?paf_dm=full&paf_gear_id=1100010&detailArticle=true&id=9606 22 | # 23 | # JMeter objects can generally be grouped into three life-length groups: 24 | # 25 | # - Per-sample objects (results, DOMs,...). An awful lot of those. 26 | # Life length of milliseconds to a few seconds. 27 | # 28 | # - Per-run objects (threads, listener data structures,...). Not that many 29 | # of those unless we use the table or tree listeners on heavy runs. 30 | # Life length of minutes to several hours, from creation to start of next run. 31 | # 32 | # - Per-work-session objects (test plans, GUIs,...). 33 | # Life length: for the life of the JVM. 34 | 35 | # This is the base heap size -- you may increase or decrease it to fit your 36 | # system's memory availablity: 37 | HEAP="-Xms256m -Xmx256m" 38 | 39 | # There's an awful lot of per-sample objects allocated during test run, so we 40 | # need a large eden to avoid too frequent scavenges -- you'll need to tune this 41 | # down proportionally if you reduce the HEAP values above: 42 | NEW="-XX:NewSize=128m -XX:MaxNewSize=128m" 43 | 44 | # This ratio and target have been proven OK in tests with a specially high 45 | # amount of per-sample objects (the HtmlParserHTMLParser tests): 46 | # SURVIVOR="-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%" 47 | 48 | # Think about it: trying to keep per-run objects in tenuring definitely 49 | # represents a cost, but where's the benefit? They won't disappear before 50 | # the test is over, and at that point we will no longer care about performance. 51 | # 52 | # So we will have JMeter do an explicit Full GC before starting a test run, 53 | # but then we won't make any effort (or spend any CPU) to keep objects 54 | # in tenuring longer than the life of per-sample objects -- which is hopefully 55 | # shorter than the period between two scavenges): 56 | # 57 | TENURING="-XX:MaxTenuringThreshold=2" 58 | 59 | # This evacuation ratio is OK (see the comments for SURVIVOR) during test 60 | # runs -- no so sure about operations that bring a lot of long-lived information into 61 | # memory in a short period of time, such as loading tests or listener data files. 62 | # Increase it if you experience OutOfMemory problems during those operations 63 | # without having gone through a lot of Full GC-ing just before the OOM: 64 | # EVACUATION="-XX:MaxLiveObjectEvacuationRatio=20%" 65 | 66 | # Avoid the RMI-induced Full GCs to run too frequently -- once every ten minutes 67 | # should be more than enough: 68 | RMIGC="-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000" 69 | 70 | # PermSize is a scam. Leave it like this: 71 | PERM="-XX:PermSize=64m -XX:MaxPermSize=64m" 72 | 73 | # Finally, some tracing to help in case things go astray: 74 | DEBUG="-verbose:gc -XX:+PrintTenuringDistribution" 75 | 76 | SERVER="-server" 77 | 78 | ARGS="$SERVER $HEAP $NEW $SURVIVOR $TENURING $EVACUATION $RMIGC $PERM $DEBUG" 79 | 80 | java -server -jar `dirname $0`/ApacheJMeter.jar report "$@" 81 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-report.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem set JAVA_HOME=c:/jdk1.5.0 19 | 20 | if not "%OS%"=="Windows_NT" goto win9xStart 21 | :winNTStart 22 | @setlocal 23 | 24 | rem Need to check if we are using the 4NT shell... 25 | if "%eval[2+2]" == "4" goto setup4NT 26 | 27 | rem On NT/2K grab all arguments at once 28 | set JMETER_CMD_LINE_ARGS=%* 29 | goto doneStart 30 | 31 | :setup4NT 32 | set JMETER_CMD_LINE_ARGS=%$ 33 | goto doneStart 34 | 35 | :win9xStart 36 | rem Slurp the command line arguments. This loop allows for an unlimited number of 37 | rem agruments (up to the command line limit, anyway). 38 | 39 | set JMETER_CMD_LINE_ARGS= 40 | 41 | :setupArgs 42 | if %1a==a goto doneStart 43 | set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1 44 | shift 45 | goto setupArgs 46 | 47 | :doneStart 48 | rem This label provides a place for the argument list loop to break out 49 | rem and for NT handling to skip to. 50 | 51 | rem See the unix startup file for the rationale of the following parameters, 52 | rem including some tuning recommendations 53 | set HEAP=-Xms256m -Xmx256m 54 | set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m 55 | set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50% 56 | set TENURING=-XX:MaxTenuringThreshold=2 57 | set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 58 | set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m 59 | set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution 60 | rem set ARGS=%HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DEBUG% 61 | set ARGS=-server -Xms128m -Xmx512m 62 | 63 | %JAVA_HOME%/bin/java %JVM_ARGS% %ARGS% -jar ApacheJMeter.jar report %JMETER_CMD_LINE_ARGS% 64 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | ## To change the RMI/Server port: 19 | ## 20 | ## SERVER_PORT=1234 jmeter-server 21 | ## 22 | 23 | DIRNAME=`dirname $0` 24 | 25 | # If the client fails with: 26 | # ERROR - jmeter.engine.ClientJMeterEngine: java.rmi.ConnectException: Connection refused to host: 127.0.0.1 27 | # then it may be due to the server host returning 127.0.0.1 as its address 28 | 29 | # One way to fix this is to define RMI_HOST_DEF below 30 | #RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx 31 | 32 | ${DIRNAME}/jmeter ${RMI_HOST_DEF} -Dserver_port=${SERVER_PORT:-1099} -s -j jmeter-server.log "$@" 33 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-server.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem =============================================================== 19 | rem Enviroment variables 20 | rem SERVER_PORT (optional) - define the rmiregistry and server port 21 | rem 22 | rem JVM_ARGS - Java flags - these are handled by jmeter.bat 23 | rem 24 | rem =============================================================== 25 | 26 | 27 | REM Protect environment against changes if possible: 28 | if "%OS%"=="Windows_NT" setlocal 29 | 30 | rem Need to check if we are using the 4NT shell... 31 | rem [Does that support the ~ constructs?] 32 | if "%eval[2+2]" == "4" goto winNT1 33 | if exist jmeter-server.bat goto winNT1 34 | echo Changing to JMeter home directory 35 | cd /D %~dp0 36 | :winNT1 37 | 38 | if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP 39 | echo Could not find ApacheJmeter_core.jar ... 40 | REM Try to work out JMETER_HOME 41 | echo ... Trying JMETER_HOME=.. 42 | set JMETER_HOME=.. 43 | if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP 44 | echo ... trying JMETER_HOME=. 45 | set JMETER_HOME=. 46 | if exist %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar goto setCP 47 | echo Cannot determine JMETER_HOME ! 48 | goto exit 49 | 50 | :setCP 51 | echo Found ApacheJMeter_core.jar 52 | 53 | REM No longer need to create the rmiregistry as it is done by the server 54 | REM set CLASSPATH=%JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar;%JMETER_HOME%\lib\logkit-1.2.jar 55 | 56 | REM START rmiregistry %SERVER_PORT% 57 | REM 58 | 59 | if not "%OS%"=="Windows_NT" goto win9xStart 60 | :winNTStart 61 | 62 | rem Need to check if we are using the 4NT shell... 63 | if "%eval[2+2]" == "4" goto setup4NT 64 | 65 | rem On NT/2K grab all arguments at once 66 | set JMETER_CMD_LINE_ARGS=%* 67 | goto doneStart 68 | 69 | :setup4NT 70 | set JMETER_CMD_LINE_ARGS=%$ 71 | goto doneStart 72 | 73 | :win9xStart 74 | rem Slurp the command line arguments. This loop allows for an unlimited number of 75 | rem agruments (up to the command line limit, anyway). 76 | 77 | set JMETER_CMD_LINE_ARGS= 78 | 79 | :setupArgs 80 | if %1a==a goto doneStart 81 | set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1 82 | shift 83 | goto setupArgs 84 | 85 | :doneStart 86 | rem This label provides a place for the argument list loop to break out 87 | rem and for NT handling to skip to. 88 | 89 | if not "%SERVER_PORT%" == "" goto port 90 | 91 | call jmeter -s -j jmeter-server.log %JMETER_CMD_LINE_ARGS% 92 | goto end 93 | 94 | 95 | :port 96 | call jmeter -Dserver_port=%SERVER_PORT% -s -j jmeter-server.log %JMETER_CMD_LINE_ARGS% 97 | 98 | :end 99 | 100 | rem No longer needed, as server is started in-process 101 | rem taskkill /F /IM rmiregistry.exe 102 | 103 | :exit -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter-t.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem ============================================ 19 | rem 20 | rem Drop a JMX file on this batch script, and it 21 | rem will load it in the GUI. 22 | rem 23 | rem Only the first parameter is used. 24 | rem Only works for Win2k. 25 | rem 26 | rem ============================================ 27 | 28 | 29 | if "%OS%"=="Windows_NT" goto WinNT 30 | echo "Sorry, this command file requires Windows NT/ 2000 / XP" 31 | pause 32 | goto END 33 | :WinNT 34 | 35 | rem Check file is supplied 36 | if a == a%1 goto winNT2 37 | 38 | rem Allow special name LAST 39 | if LAST == %1 goto winNT3 40 | 41 | rem Check it has extension .jmx 42 | if "%~x1" == ".jmx" goto winNT3 43 | :winNT2 44 | echo Please supply a script name with the extension .jmx 45 | pause 46 | goto END 47 | :winNT3 48 | 49 | rem Start in directory with JMX file 50 | pushd %~dp1 51 | 52 | rem Prepend the directory in which this script resides in case not on path 53 | 54 | call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9 55 | 56 | popd 57 | 58 | :END -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeter.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | ## Basic JMeter startup script for Un*x systems 19 | ## See the "jmeter" script for details of options that can be used for Sun JVMs 20 | 21 | ## ============================================== 22 | ## Environment variables: 23 | ## JVM_ARGS - optional java args, e.g. -Dprop=val 24 | ## 25 | ## e.g. 26 | ## JVM_ARGS="-Xms512m -Xmx512m" jmeter.sh etc. 27 | ## 28 | ## ============================================== 29 | 30 | # Add Mac-specific property - should be ignored elsewhere (Bug 47064) 31 | java $JVM_ARGS -Dapple.laf.useScreenMenuBar=true -jar `dirname $0`/ApacheJMeter.jar "$@" 32 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/jmeterw.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Run JMeter using javaw 3 | 4 | rem Licensed to the Apache Software Foundation (ASF) under one or more 5 | rem contributor license agreements. See the NOTICE file distributed with 6 | rem this work for additional information regarding copyright ownership. 7 | rem The ASF licenses this file to You under the Apache License, Version 2.0 8 | rem (the "License"); you may not use this file except in compliance with 9 | rem the License. You may obtain a copy of the License at 10 | rem 11 | rem http://www.apache.org/licenses/LICENSE-2.0 12 | rem 13 | rem Unless required by applicable law or agreed to in writing, software 14 | rem distributed under the License is distributed on an "AS IS" BASIS, 15 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | rem See the License for the specific language governing permissions and 17 | rem limitations under the License. 18 | 19 | set JM_START=start 20 | set JM_LAUNCH=javaw.exe 21 | 22 | rem Only works in Win2K 23 | call jmeter %* 24 | 25 | set JM_START= 26 | set JM_LAUNCH= -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/log4j.conf: -------------------------------------------------------------------------------- 1 | 2 | ## Licensed to the Apache Software Foundation (ASF) under one or more 3 | ## contributor license agreements. See the NOTICE file distributed with 4 | ## this work for additional information regarding copyright ownership. 5 | ## The ASF licenses this file to You under the Apache License, Version 2.0 6 | ## (the "License"); you may not use this file except in compliance with 7 | ## the License. You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | 17 | # Set appender specific options 18 | 19 | log4j.appender.Root_Appender=org.apache.log4j.RollingFileAppender 20 | log4j.appender.Root_Appender.File=root.log 21 | log4j.appender.Root_Appender.Append=true 22 | log4j.appender.Root_Appender.MaxBackupIndex=0 23 | log4j.appender.Root_Appender.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.Root_Appender.layout.ConversionPattern=%-5p %d{MM/dd, hh:mm:ss} %-20.30c %m%n 25 | 26 | log4j.appender.File_Appender=org.apache.log4j.RollingFileAppender 27 | log4j.appender.File_Appender.File=extra.log 28 | log4j.appender.File_Appender.Append=false 29 | log4j.appender.File_Appender.layout=org.apache.log4j.PatternLayout 30 | log4j.appender.File_Appender.layout.ConversionPattern=%r %d{MM/dd, hh:mm:ss} %-5p %-50.50c %m%n 31 | 32 | log4j.appender.SystemOut_Appender=org.apache.log4j.ConsoleAppender 33 | log4j.appender.SystemOut_Appender.layout=org.apache.log4j.SimpleLayout 34 | 35 | 36 | # Set the appenders for the categories 37 | log4j.rootCategory=INFO,Root_Appender 38 | #log4j.configDebug -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/mirror-server.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem Run the JMeter mirror server in non-GUI mode 19 | rem P1 = port to use (default 8080) 20 | 21 | setlocal 22 | 23 | cd /D %~dp0 24 | 25 | set CP=..\lib\ext\ApacheJMeter_http.jar;..\lib\ext\ApacheJMeter_core.jar;..\lib\jorphan.jar 26 | set CP=%CP%;..\lib\logkit-2.0.jar;..\lib\avalon-framework-4.1.4.jar;..\lib\oro-2.0.8.jar 27 | 28 | java -cp %CP% org.apache.jmeter.protocol.http.control.HttpMirrorServer %1 29 | 30 | pause 31 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/mirror-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | # Run the JMeter mirror server in non-GUI mode 19 | # P1 = port to use (default 8080) 20 | 21 | cd `dirname $0` 22 | 23 | CP=../lib/ext/ApacheJMeter_http.jar:../lib/ext/ApacheJMeter_core.jar:../lib/jorphan.jar 24 | CP=${CP}:../lib/logkit-2.0.jar:../lib/avalon-framework-4.1.4.jar:../lib/oro-2.0.8.jar 25 | 26 | java -cp $CP org.apache.jmeter.protocol.http.control.HttpMirrorServer $1 27 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/proxyserver.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/bin/proxyserver.jks -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/shutdown.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem Run the Shutdown client to stop a non-GUI instance gracefully 19 | 20 | rem P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | java -cp %~dp0ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient Shutdown %* 23 | pause -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | # Run the Shutdown client to stop a non-GUI instance gracefully 19 | 20 | # P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | DIRNAME=`dirname $0` 23 | 24 | java -cp ${DIRNAME}/ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient Shutdown "$@" 25 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/stoptest.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem Run the Shutdown client to stop a non-GUI instance abruptly 19 | 20 | rem P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | java -cp %~dp0ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient StopTestNow %* 23 | pause -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/stoptest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | # Run the Shutdown client to stop a non-GUI instance abruptly 19 | 20 | # P1 = command port for JMeter instance (defaults to 4445) 21 | 22 | DIRNAME=`dirname $0` 23 | 24 | java -cp ${DIRNAME}/ApacheJMeter.jar org.apache.jmeter.util.ShutdownClient StopTestNow "$@" 25 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/system.properties: -------------------------------------------------------------------------------- 1 | # Sample system.properties file 2 | # 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | # 18 | # For details of Oracle Java network properties, see for example: 19 | # http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html 20 | # 21 | # Sample properties: 22 | # 23 | #java.net.preferIPv4Stack=false 24 | #java.net.preferIPv6Addresses=false 25 | #networkaddress.cache.ttl=-1 26 | #networkaddress.cache.negative.ttl=10 27 | # 28 | # 29 | # SSL properties (moved from jmeter.properties) 30 | 31 | # See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Customization 32 | # for information on the javax.ssl system properties 33 | 34 | # Truststore properties (trusted certificates) 35 | #javax.net.ssl.trustStore=/path/to/[jsse]cacerts 36 | #javax.net.ssl.trustStorePassword 37 | #javax.net.ssl.trustStoreProvider 38 | #javax.net.ssl.trustStoreType [default = KeyStore.getDefaultType()] 39 | 40 | # Keystore properties (client certificates) 41 | # Location 42 | #javax.net.ssl.keyStore=.keystore 43 | # 44 | #The password to your keystore 45 | #javax.net.ssl.keyStorePassword=changeit 46 | # 47 | #javax.net.ssl.keyStoreProvider 48 | #javax.net.ssl.keyStoreType [default = KeyStore.getDefaultType()] 49 | 50 | # SSL debugging: 51 | # See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug 52 | # 53 | # javax.net.debug=help - generates the list below: 54 | #all turn on all debugging 55 | #ssl turn on ssl debugging 56 | # 57 | #The following can be used with ssl: 58 | # record enable per-record tracing 59 | # handshake print each handshake message 60 | # keygen print key generation data 61 | # session print session activity 62 | # defaultctx print default SSL initialization 63 | # sslctx print SSLContext tracing 64 | # sessioncache print session cache tracing 65 | # keymanager print key manager tracing 66 | # trustmanager print trust manager tracing 67 | # 68 | # handshake debugging can be widened with: 69 | # data hex dump of each handshake message 70 | # verbose verbose handshake message printing 71 | # 72 | # record debugging can be widened with: 73 | # plaintext hex dump of record plaintext 74 | # 75 | # Examples: 76 | #javax.net.debug=ssl 77 | #javax.net.debug=sslctx,session,sessioncache 78 | # 79 | # 80 | # We enable the following property to allow headers such as "Host" to be passed through. 81 | # See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996110 82 | sun.net.http.allowRestrictedHeaders=true -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/bin/user.properties: -------------------------------------------------------------------------------- 1 | # Sample user.properties file 2 | # 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | #--------------------------------------------------------------------------- 19 | # Classpath configuration 20 | #--------------------------------------------------------------------------- 21 | # 22 | # List of paths (separated by ;) to search for additional JMeter extension classes 23 | # - for example new GUI elements and samplers 24 | # These are in addition to lib/ext. Do not use this for utility jars. 25 | #search_paths=/app1/lib;/app2/lib 26 | 27 | # Users can define additional classpath items by setting the property below 28 | # - for example, utility jars or JUnit test cases 29 | # 30 | # Use the default separator for the host version of Java 31 | # Paths with spaces may cause problems for the JVM 32 | #user.classpath=../classes;../jars/jar1.jar 33 | 34 | #--------------------------------------------------------------------------- 35 | # Logging configuration 36 | #--------------------------------------------------------------------------- 37 | #log_level.jorphan.reflect=DEBUG 38 | # Warning: enabling the next debug line causes javax.net.ssl.SSLException: Received fatal alert: unexpected_message 39 | # for certain sites when used with the default HTTP Sampler 40 | #log_level.jmeter.util.HttpSSLProtocolSocketFactory=DEBUG 41 | #log_level.jmeter.util.JsseSSLManager=DEBUG 42 | 43 | # Enable Proxy request debug 44 | #log_level.jmeter.protocol.http.proxy.HttpRequestHdr=DEBUG 45 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/ConvertHTTPSampler.txt: -------------------------------------------------------------------------------- 1 | === HTTPSampler to HTTPSampler2 convertion === 2 | 3 | If the testcase was created with an old version, load it into 2.1.1 and save it. 4 | Edit the testcase and replace the following: 5 | 6 | Old 7 | === 8 | 9 | ... 10 | 11 | 12 | New 13 | === 14 | 15 | ... 16 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/addons.txt: -------------------------------------------------------------------------------- 1 | This file describes how to create local additions to JMeter. 2 | 3 | Create a new directory for the sources: 4 | 5 | cd JMETER_HOME 6 | 7 | mkdir addons 8 | 9 | Copy addons.xml into JMETER_HOME 10 | 11 | To build the addons, run ant as follows: 12 | 13 | ant -buildfile=addons.xml 14 | 15 | This will compile the sources to build/addons/... 16 | 17 | If successful, it will also create the jar file: 18 | 19 | JMETER_HOME/lib/ext/ApacheJmeter_addons.jar 20 | 21 | As the filename of this jar is alphabetically earlier, 22 | any classes in it will be used in preference to existing JMeter classes. 23 | 24 | This allows the addons to be used to supply new functionality as well 25 | as overriding existing functionality, without needing to rebuild JMeter. 26 | 27 | Such addons are intended mainly to be used locally - for example if you 28 | have developed any new code that is only relevant to your organisation. 29 | 30 | It can also be useful for developing general purpose add-ons that are 31 | intended for general release. Once tested, these can be moved into one of 32 | the normal JMeter source directories. 33 | 34 | N.B. The build file assumes that JMeter has been built separately, as 35 | JMeter classes are resolved from jars in the lib and lib/ext directories. 36 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/addons.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/ant-jmeter-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/extras/ant-jmeter-1.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/extras/collapse.png -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/convertjmx.fdl: -------------------------------------------------------------------------------- 1 | ! Licensed to the Apache Software Foundation (ASF) under one or more 2 | ! contributor license agreements. See the NOTICE file distributed with 3 | ! this work for additional information regarding copyright ownership. 4 | ! The ASF licenses this file to You under the Apache License, Version 2.0 5 | ! (the "License"); you may not use this file except in compliance with 6 | ! the License. You may obtain a copy of the License at 7 | ! 8 | ! http://www.apache.org/licenses/LICENSE-2.0 9 | ! 10 | ! Unless required by applicable law or agreed to in writing, software 11 | ! distributed under the License is distributed on an "AS IS" BASIS, 12 | ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ! See the License for the specific language governing permissions and 14 | ! limitations under the License. 15 | ! 16 | ! Convert JMX files so Java can read them on OpenVMS 17 | ! ================================================== 18 | ! 19 | ! This will be needed if the JMX is in VARIABLE format. 20 | ! 21 | ! Usage: 22 | ! CONVERT/FDL=CONVERTJMX input.jmx output.jmx 23 | ! 24 | ! 25 | RECORD 26 | CARRIAGE_CONTROL carriage_return 27 | FORMAT stream_lf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/execcode.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /** 20 | Start an external application using the Java Runtime exec() method. 21 | Display any output to the standard BeanShell output using print(). 22 | Return the process exit code. 23 | Note: does not display stderr. 24 | */ 25 | 26 | bsh.help.execcode = "usage: execcode( String arg )"; 27 | 28 | int execcode( String arg ) 29 | { 30 | this.proc = Runtime.getRuntime().exec(arg); 31 | this.din = new DataInputStream( proc.getInputStream() ); 32 | while( (line=din.readLine()) != null ) { 33 | print(line); 34 | } 35 | return this.proc.waitFor(); 36 | } 37 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/extras/expand.png -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/jmeter.fb: -------------------------------------------------------------------------------- 1 | [Jar files] 2 | bin/apachejmeter.jar 3 | lib/ext/apachejmeter_components.jar 4 | lib/ext/apachejmeter_core.jar 5 | lib/ext/apachejmeter_ftp.jar 6 | lib/ext/apachejmeter_functions.jar 7 | lib/ext/apachejmeter_http.jar 8 | lib/ext/apachejmeter_java.jar 9 | lib/ext/apachejmeter_jdbc.jar 10 | lib/ext/apachejmeter_ldap.jar 11 | lib/ext/apachejmeter_mail.jar 12 | lib/ext/apachejmeter_monitors.jar 13 | lib/ext/apachejmeter_tcp.jar 14 | lib/jorphan.jar 15 | [Source dirs] 16 | src/components 17 | src/core 18 | src/examples 19 | src/functions 20 | src/htmlparser 21 | src/jorphan 22 | src/monitor/components 23 | src/monitor/model 24 | src/protocol/ftp 25 | src/protocol/html 26 | src/protocol/java 27 | src/protocol/jdbc 28 | src/protocol/ldap 29 | src/protocol/mail 30 | src/protocol/tcp 31 | [Aux classpath entries] 32 | lib/avalon-framework-4.1.4.jar 33 | lib/batik-awt-util.jar 34 | lib/commons-collections.jar 35 | lib/commons-httpclient-2.0.jar 36 | lib/commons-logging.jar 37 | lib/excalibur-compatibility-1.1.jar 38 | lib/excalibur-datasource-1.1.1.jar 39 | lib/excalibur-i18n-1.1.jar 40 | lib/excalibur-instrument-1.0.jar 41 | lib/excalibur-logger-1.1.jar 42 | lib/excalibur-pool-1.2.jar 43 | lib/htmlparser.jar 44 | lib/jakarta-oro-2.0.8.jar 45 | lib/jdom-b9.jar 46 | lib/js.jar 47 | lib/junit.jar 48 | lib/logkit-1.2.jar 49 | lib/soap.jar 50 | lib/tidy.jar 51 | lib/velocity-1.4-dev.jar 52 | lib/xalan.jar 53 | lib/xercesimpl.jar 54 | lib/xml-apis.jar 55 | lib/xpp3-1.1.3.4.d.jar 56 | lib/xstream-1.0.1.jar 57 | lib/opt/activation.jar 58 | lib/opt/bsf.jar 59 | lib/opt/bsh-2.0b1.jar 60 | lib/opt/mail.jar 61 | [Options] 62 | relative_paths=true 63 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/printvars.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // Sample script to print JMeter variables 20 | print(">>>>"); 21 | Iterator i = vars.getIterator(); 22 | while(i.hasNext()) 23 | { 24 | Map.Entry me = i.next(); 25 | if(String.class.equals(me.getValue().getClass())){ 26 | print(me); 27 | } 28 | } 29 | print("<<<<"); 30 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/proxycert.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | 4 | rem Licensed to the Apache Software Foundation (ASF) under one or more 5 | rem contributor license agreements. See the NOTICE file distributed with 6 | rem this work for additional information regarding copyright ownership. 7 | rem The ASF licenses this file to You under the Apache License, Version 2.0 8 | rem (the "License"); you may not use this file except in compliance with 9 | rem the License. You may obtain a copy of the License at 10 | rem 11 | rem http://www.apache.org/licenses/LICENSE-2.0 12 | rem 13 | rem Unless required by applicable law or agreed to in writing, software 14 | rem distributed under the License is distributed on an "AS IS" BASIS, 15 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | rem See the License for the specific language governing permissions and 17 | rem limitations under the License. 18 | 19 | rem Generate proxyserver certificate for JMeter 20 | 21 | set DNAME="cn=JMeter Proxy, ou=JMeter, o=Apache Software Foundation, c=US" 22 | 23 | rem generate the keystore with the certificate 24 | keytool -genkey -alias jmeter -keystore proxyserver.jks -keypass password -storepass password -validity 1825 -keyalg RSA -dname %DNAME% 25 | 26 | rem show the contents 27 | keytool -list -v -keystore proxyserver.jks -storepass password 28 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/proxycert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Licensed to the Apache Software Foundation (ASF) under one or more 4 | ## contributor license agreements. See the NOTICE file distributed with 5 | ## this work for additional information regarding copyright ownership. 6 | ## The ASF licenses this file to You under the Apache License, Version 2.0 7 | ## (the "License"); you may not use this file except in compliance with 8 | ## the License. You may obtain a copy of the License at 9 | ## 10 | ## http://www.apache.org/licenses/LICENSE-2.0 11 | ## 12 | ## Unless required by applicable law or agreed to in writing, software 13 | ## distributed under the License is distributed on an "AS IS" BASIS, 14 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ## See the License for the specific language governing permissions and 16 | ## limitations under the License. 17 | 18 | 19 | ## Generate proxyserver certificate for JMeter 20 | 21 | DNAME="cn=JMeter Proxy, ou=JMeter, o=Apache Software Foundation, c=US" 22 | 23 | ## generate the keystore with the certificate 24 | keytool -genkey -alias jmeter -keystore proxyserver.jks -keypass password -storepass password -validity 1825 -keyalg RSA -dname ${DNAME} 25 | 26 | ## show the contents 27 | keytool -list -v -keystore proxyserver.jks -storepass password 28 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/remote.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // remote.bsh 20 | // Sample remote file for use with bshclient 21 | // 22 | // Usage: 23 | // java -jar ../lib/bshclent.jar localhost 9000 ../extras/bsh.remote [arg1 arg2 ...] 24 | // Note: port 9000 is specified, but the jar actually uses 9001 (telnet) 25 | // 26 | 27 | print("remote.bsh starting"); 28 | 29 | if (args.length > 0){ 30 | print("Arguments:"); 31 | print(args); 32 | } 33 | 34 | printsysprop("user.home"); 35 | printsysprop("user.dir"); 36 | 37 | printprop("log_level.jmeter"); 38 | printprop("log_level.jorphan"); 39 | 40 | // loglevel("DEBUG","jmeter"); 41 | 42 | for(i=0;i<10;i++){ 43 | setprop("EXAMPLE",i.toString()); 44 | Thread.sleep(1000); 45 | } 46 | printprop("EXAMPLE"); 47 | 48 | print("remote.bsh ended"); -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/schematic.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Licensed to the Apache Software Foundation (ASF) under one or more 4 | rem contributor license agreements. See the NOTICE file distributed with 5 | rem this work for additional information regarding copyright ownership. 6 | rem The ASF licenses this file to You under the Apache License, Version 2.0 7 | rem (the "License"); you may not use this file except in compliance with 8 | rem the License. You may obtain a copy of the License at 9 | rem 10 | rem http://www.apache.org/licenses/LICENSE-2.0 11 | rem 12 | rem Unless required by applicable law or agreed to in writing, software 13 | rem distributed under the License is distributed on an "AS IS" BASIS, 14 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | rem See the License for the specific language governing permissions and 16 | rem limitations under the License. 17 | 18 | rem Drop a JMX file on this script to create a schematic of the test plan as an HTML file 19 | 20 | cd /d %~dp0 21 | set name=%~n1 22 | if .%1 ==. set name=Test 23 | call ant -f schematic.xml -Dtest=%name% 24 | pause -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/schematic.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | To create the schematic report: 21 | ant -Dtest=script 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/extras/startup.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // 20 | // Sample BeanShell Server Startup file 21 | // 22 | // Use as follows: 23 | // -Jbeanshell.server.port=nnnn 24 | // -Jbeanshell.server.file=../extras/startup.bsh 25 | // 26 | // Defines various utility routines for properties and logging 27 | // 28 | // 29 | 30 | // Stop exit() from calling System.exit(); 31 | bsh.system.shutdownOnExit = false; 32 | 33 | print("Startup script running"); 34 | 35 | import org.apache.jmeter.util.JMeterUtils; 36 | import org.apache.jorphan.logging.LoggingManager; 37 | 38 | getprop(p){// get a JMeter property 39 | return JMeterUtils.getPropDefault(p,""); 40 | } 41 | 42 | setprop(p,v){// set a JMeter property 43 | print("Setting property '"+p+"' to '"+v+"'."); 44 | JMeterUtils.getJMeterProperties().setProperty(p, v); 45 | } 46 | 47 | printprop(p){// print a JMeter property 48 | print(p + " = " + getprop(p)); 49 | } 50 | 51 | loglevel(String priority, String category){ 52 | LoggingManager.setPriority(priority, category); 53 | } 54 | 55 | logdebug(String text){ 56 | loglevel("DEBUG",text); 57 | } 58 | 59 | loginfo(String text){ 60 | loglevel("INFO",text); 61 | } 62 | 63 | // Define routines to stop the test or a thread 64 | stopEngine(){// Stop the JMeter test 65 | print("Stop Engine called"); 66 | org.apache.jmeter.engine.StandardJMeterEngine.stopEngine(); 67 | } 68 | 69 | stopEngineNow(){// Stop the JMeter test now 70 | print("Stop Engine NOW called"); 71 | org.apache.jmeter.engine.StandardJMeterEngine.stopEngineNow(); 72 | } 73 | 74 | stopThread(t){// Stop a JMeter thread 75 | print("Stop Thread "+t+" called"); 76 | ok=org.apache.jmeter.engine.StandardJMeterEngine.stopThread(t); 77 | if (ok){print("Thread requested to stop");} else { print("Thread not found");} 78 | } 79 | 80 | stopThreadNow(t){// Stop a JMeter thread 81 | print("Stop Thread Now "+t+" called"); 82 | ok=org.apache.jmeter.engine.StandardJMeterEngine.stopThreadNow(t); 83 | if (ok){print("Thread stopped");} else { print("Thread not found");} 84 | } 85 | 86 | getsysprop(p){// get a system property 87 | return System.getProperty(p,""); 88 | } 89 | 90 | setsysprop(p,v){// set a system property 91 | print("Setting property '"+p+"' to '"+v+"'."); 92 | System.setProperty(p, v); 93 | } 94 | 95 | printsysprop(p){// print a system property 96 | print(p + " = " + getsysprop(p)); 97 | } 98 | 99 | print("Startup script completed"); -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/activation-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/activation-1.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/avalon-framework-4.1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/avalon-framework-4.1.4.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/bsf-2.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/bsf-2.4.0.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/bsh-2.0b5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/bsh-2.0b5.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/bshclient.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/bshclient.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-codec-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-codec-1.6.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-httpclient-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-httpclient-3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-io-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-io-2.2.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-jexl-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-jexl-1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-jexl-2.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-jexl-2.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-lang-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-lang-2.6.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-lang3-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-lang3-3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-net-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/commons-net-3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-datasource-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-datasource-1.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-instrument-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-instrument-1.0.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-logger-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-logger-1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-pool-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/excalibur-pool-1.2.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_components.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_components.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_core.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_ftp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_ftp.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_functions.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_functions.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_http.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_http.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_java.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_java.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_jdbc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_jdbc.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_jms.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_jms.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_junit.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_ldap.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_ldap.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_mail.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_monitors.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_monitors.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_native.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_native.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_report.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_report.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_tcp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/ext/ApacheJMeter_tcp.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/geronimo-jms_1.1_spec-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/geronimo-jms_1.1_spec-1.1.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/htmllexer-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/htmllexer-2.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/htmlparser-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/htmlparser-2.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpclient-4.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpclient-4.2.3.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpcore-4.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpcore-4.2.3.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpmime-4.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/httpmime-4.2.3.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jcharts-0.7.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jcharts-0.7.5.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jdom-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jdom-1.1.2.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jodd-core-3.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jodd-core-3.4.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jodd-lagarto-3.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jodd-lagarto-3.4.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jorphan.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jorphan.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jsoup-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jsoup-1.7.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/jtidy-r938.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/jtidy-r938.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/junit-4.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/junit-4.10.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/junit/test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/junit/test.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/logkit-2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/logkit-2.0.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/mail-1.4.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/mail-1.4.4.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/oro-2.0.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/oro-2.0.8.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/rhino-1.7R4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/rhino-1.7R4.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/serializer-2.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/serializer-2.7.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/slf4j-api-1.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/slf4j-api-1.7.2.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/soap-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/soap-2.3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/tika-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/tika-core-1.3.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/tika-parsers-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/tika-parsers-1.3.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xalan-2.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xalan-2.7.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xercesImpl-2.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xercesImpl-2.9.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xml-apis-1.3.04.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xml-apis-1.3.04.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xmlgraphics-commons-1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xmlgraphics-commons-1.3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xmlpull-1.1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xmlpull-1.1.3.1.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xpp3_min-1.1.4c.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xpp3_min-1.1.4c.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/lib/xstream-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/lib/xstream-1.4.2.jar -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/changes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/changes.html -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/demos/BeanShellAssertion.bsh: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // Sample BeanShell Assertion script 20 | // Derived from http://www.mail-archive.com/jmeter-user@jakarta.apache.org/msg05597.html 21 | 22 | if (ResponseCode != null && ResponseCode.equals ("200") == false ) 23 | { 24 | // this is standard stuff 25 | Failure=true ; 26 | FailureMessage ="Response code was not a 200 response code it was " + ResponseCode + "." ; 27 | print ( "the return code is " + ResponseCode); // this goes to stdout 28 | log.warn( "the return code is " + ResponseCode); // this goes to the JMeter log file 29 | } else { 30 | try 31 | { 32 | // non standard stuff where BeanShell assertion will be really powerful . 33 | // in my example I just test the size , but you could extend it further 34 | // to actually test the content against another file. 35 | byte [] arr = (byte[]) ResponseData ; 36 | // print ( arr.length ) ; // use this to determine the size 37 | if (arr != null && arr.length != 25218) 38 | { 39 | Failure= true ; 40 | FailureMessage = "The response data size was not as expected" ; 41 | } 42 | else if ( arr == null ) 43 | { 44 | Failure= true ; 45 | FailureMessage = "The response data size was null" ; 46 | } 47 | } 48 | catch ( Throwable t ) 49 | { 50 | print ( t ) ; 51 | log.warn("Error: ",t); 52 | } 53 | } -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/demos/ProxyServerTestPlan.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8080 8 | 9 | 10 | true 11 | 0 12 | false 13 | 0 14 | false 15 | true 16 | true 17 | false 18 | false 19 | false 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/extending/jmeter_tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/extending/jmeter_tutorial.pdf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/jmeter_irc.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | Apache JMeter - JMeter on IRC 24 | 25 | 26 | 27 | 28 | 31 | 34 | 35 |
29 | 30 | 32 | Apache JMeter 33 |
36 | 37 | 40 | 41 | 75 | 76 | 79 | 80 | 98 | 99 |
38 |
39 |
42 |
43 | 44 | 48 | 71 | 72 |
45 | 46 | JMeter on IRC 47 |
49 |
50 |

51 | JMeter developers often hang out on IRC to chat about development issues. 52 | Users are also welcome to stop by and ask questions, offer feature suggestions, 53 | or just chit-chat. 54 |

55 |

56 | IRC Server: 57 | 58 | irc.us.freenode.net 59 | 60 |
61 | 62 | 63 | Room: 64 | 65 | #jmeter 66 | 67 |

68 |
69 |

70 |

73 |
74 |
77 |
78 |
81 | 82 | 83 | 88 | 89 | 96 |
84 | 85 | Copyright © 1999-2013, Apache Software Foundation 86 | 87 |
90 |
91 | Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are 92 | trademarks of the Apache Software Foundation. 93 | 94 |
95 |
97 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/include_controller_tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/include_controller_tutorial.pdf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_accesslog_sampler_step_by_step.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_accesslog_sampler_step_by_step.pdf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_distributed_testing_step_by_step.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_distributed_testing_step_by_step.pdf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_proxy_step_by_step.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/jmeter_proxy_step_by_step.pdf -------------------------------------------------------------------------------- /zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/junitsampler_tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilbeveridge/zuul-netty/ec1975b958088f6f024963b117e9c2b38e455d87/zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/junitsampler_tutorial.pdf --------------------------------------------------------------------------------