├── .gitignore
├── README.md
├── docker
├── hotswap-vm
│ ├── Dockerfile
│ └── build.sh
├── meecrowave
│ ├── Dockerfile
│ └── build.sh
├── openliberty-kernel
│ ├── Dockerfile
│ ├── build.sh
│ └── docker-server
├── openliberty-microprofile
│ ├── Dockerfile
│ ├── build.sh
│ └── server.xml
├── payara-micro
│ ├── Dockerfile
│ └── build.sh
└── wildfly-hollow-swarm
│ ├── Dockerfile
│ └── build.sh
├── dropwizard
├── Dockerfile
├── build-dropwizard.sh
├── dependency-reduced-pom.xml
├── example.yml
├── pom.xml
├── run-dropwizard.sh
└── src
│ └── main
│ └── java
│ └── org
│ └── hotswap
│ └── test
│ └── dropwizard
│ └── ping
│ ├── PingPerfApplication.java
│ ├── PingPerfConfiguration.java
│ ├── PingResource.java
│ └── Statistics.java
├── jmeter_50users.jmx
├── micronaut
├── Dockerfile
├── build-micronaut.sh
├── dependency-reduced-pom.xml
├── micronaut-cli.yml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── run-mikronaut.sh
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── hotswap
│ │ └── test
│ │ └── micronaut
│ │ ├── Application.java
│ │ ├── PingController.java
│ │ └── Statistics.java
│ └── resources
│ ├── application.properties
│ └── logback.xml
├── microprofile
├── Dockerfile.meecrowave
├── Dockerfile.openliberty-micro
├── Dockerfile.payara-micro
├── Dockerfile.wildfly-hollow-swarm
├── build-meecrowave.sh
├── build-openliberty-micro.sh
├── build-payara-micro.sh
├── build-wildfly-hollow-swarm.sh
├── jmeter_50users.jmx
├── jmeter_50users_spring-boot.jmx
├── liberty.jvm.options
├── pom.xml
├── run-meecrowave.sh
├── run-openliberty-micro.sh
├── run-payara-micro.sh
├── run-wildfly-hollow-swarm.sh
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── hotswap
│ │ └── test
│ │ └── jaxrs
│ │ └── ping
│ │ ├── PingResource.java
│ │ ├── RESTConfiguration.java
│ │ └── Statistics.java
│ └── webapp
│ ├── META-INF
│ ├── MANIFEST.MF
│ └── context.xml
│ └── WEB-INF
│ └── beans.xml
├── quarkus
├── .gitignore
├── Dockerfile.quarkus-jvm
├── Dockerfile.quarkus-native
├── build-quarkus-jvm.sh
├── build-quarkus-native.sh
├── pom.xml
├── run-quarkus-boot-jvm.sh
├── run-quarkus-boot-native.sh
└── src
│ └── main
│ └── java
│ └── hotswap
│ └── test
│ └── jaxrs
│ └── ping
│ ├── PingResource.java
│ └── Statistics.java
├── spring-boot
├── .gitignore
├── Dockerfile
├── README.md
├── build-spring-boot.sh
├── pom.xml
├── run-spring-boot.sh
└── src
│ └── main
│ ├── java
│ ├── META-INF
│ │ └── MANIFEST.MF
│ └── org
│ │ └── hotswap
│ │ └── test
│ │ └── springboot
│ │ ├── Application.java
│ │ └── Statistics.java
│ └── resources
│ └── application.yml
└── vertx
├── Dockerfile.vertx
├── build-vertx.sh
├── pom.xml
├── run-vertx.sh
└── src
└── main
└── java
└── pingperf
└── Main.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.ear
17 | *.zip
18 | *.tar.gz
19 | *.rar
20 |
21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22 | hs_err_pid*
23 | */target/
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ( (
2 | )\ ) )\ ) (
3 | (()/( ( ( ( (()/( ( ( )\ )
4 | /(_)))\ ( )\))( /(_)) ))\ )( (()/(
5 | (_)) ((_) )\ ) ((_))\ (_)) /((_)(()\ /(_))
6 | | _ \ (_) _(_/( (()(_)| _ \(_)) ((_)(_) _|
7 | | _/ | || ' \))/ _` | | _// -_) | '_| | _|
8 | |_| |_||_||_| \__, | |_| \___| |_| |_|
9 | |___/
10 |
11 | # Performance tests of java [MicroProfiles](https://microprofile.io/), [Spring-Boot](https://spring.io/projects/spring-boot), [Quarkus](https://quarkus.io/) and [Micronaut](https://micronaut.io/)
12 |
13 | ## Motivation
14 |
15 | Docker based comparision of java MicroProfiles and Spring-Boot using simple ping REST request. Docker images are based
16 | on images from [hotswap-docklands](https://github.com/HotswapProjects/hotswap-docklands).
17 | ## Quick start
18 |
19 | * run `build-X.sh` to build docker image for given microprofile, spring-boot, quarkus, micronaut
20 | * run `run-X.sh` to run docker image for given microprofile, spring-boot, quarkus, micronaut
21 | * run wrk test with appropriate number of clients.
22 |
23 | ## HW/OS
24 | ```
25 | @skybber ~ $ cat /proc/cpuinfo
26 | processor : 0
27 | vendor_id : AuthenticAMD
28 | cpu family : 23
29 | model : 1
30 | model name : AMD Ryzen 5 1600 Six-Core Processor
31 |
32 | @skybber ~ $ cat /proc/version
33 | Linux version 5.0.0-arch1-1-ARCH (builduser@heftig-18825) (gcc version 8.2.1 20181127 (GCC)) #1 SMP PREEMPT Mon Mar 4 14:11:43 UTC 2019
34 | ```
35 |
36 | ## Wrk load tests results
37 |
38 | Tests were splitted into 3 groups varying in the heap size and the number of users (clients):
39 |
40 | - Xmx128m running single client
41 | - Xmx128 running 50 clients
42 |
43 | ### Single thread (user) / -Xmx128m
44 |
45 | * messured second step of following script `for run in {1..2}; do wrk -t1 -c1 -d60s http://127.0.0.1:8080/pingperf/ping/simple; done`
46 | * For Open Liberty `url=http://127.0.0.1:9080/pingperf/ping/simple`
47 | * For spring-boot `url=http://127.0.0.1:8080/simple`
48 | * For quarkus+swarm `url=http://127.0.0.1:8080/ping/simple`
49 |
50 | |Microprofile|Start time|Docker mem usage|Req/s|Stdev /s|Latency|Stdev|
51 | |------------|----------|----------------|-----|--------|----------|--------|
52 | |Meecrowave 1.2.7|0.7s|197MB|10.31k|1.79k|118.12us|280.55us|
53 | |Open Liberty 19.02|~3s|250MB|4.99k|629.76|225.59us|372.52us|
54 | |Payara Micro 5.191|6s|320MB|4.96k|1.63k|223.10us|332.64us|
55 | |Wildfly Swarm 2018.3.3|5s|326MB|7.40k|2.43k|186.80us|486.31us|
56 | |Spring-Boot 2.1.1|1.5s|216MB|9.39k|1.29k|144.99us|521.05us|
57 | |Quarkus JVM 0.11|0.68s|144M|18.43k|3.77k|62.11us|269.61us|
58 | |Quarkus Native 0.11|0.023s|430M|17.86k|1.79k|78.28us|362.31us|
59 | |Micronaut 1.0.3|0.907s|200|15.19k|1.84k|84.64us|310.88us|
60 |
61 | ### 50 threads (users) / -Xmx128m
62 | * messured second step of following script `for run in {1..2}; do wrk -t4 -c50 -d60s http://127.0.0.1:8080/pingperf/ping/simple; done`
63 | * For Open Liberty `url=http://127.0.0.1:9080/pingperf/ping/simple`
64 | * For spring-boot `url=http://127.0.0.1:8080/simple`
65 | * For quarkus+swarm `url=http://127.0.0.1:8080/ping/simple`
66 |
67 | |Microprofile|Start time|Docker mem usage|Req/s|Stdev /s|Latency|Stdev|
68 | |------------|----------|----------------|-----|--------|----------|--------|
69 | |Meecrowave 1.2.7|0.7s|264MB|58879|1.25k*4|1110us|1400us|
70 | |Open Liberty 19.02|~3s|334MB|59205|1.10k*4|990us|1440us|
71 | |Payara Micro 5.191|6s|372MB|40266|0.88k*4|2330us|4440us|
72 | |Wildfly Swarm 2018.3.3|5s|388MB|62052|1.34k*4|1690us|5550us|
73 | |Spring-Boot 2.1.1|1.5s|291MB|63545|1.58k*4|1200us|1750us|
74 | |Quarkus JVM 0.11|0.57s|140M|80109|2.09k*4|625.98us|453.44us|
75 | |Quarkus Native 0.11|0.023s||28676|0.34k*4|1710us|602.95us|
76 | |Micronaut 1.0.3|0.907s|225M|140216.96|3.68k*4|1030us|2760us|
77 |
--------------------------------------------------------------------------------
/docker/hotswap-vm/Dockerfile:
--------------------------------------------------------------------------------
1 | # FROM anapsix/alpine-java:8_jdk-dcevm
2 | FROM anapsix/alpine-java:latest
3 | LABEL maintainer="hotswapagent.org" description="Ping perf dockers"
4 | RUN apk -U upgrade \
5 | && apk add curl \
6 | && apk add unzip
7 |
--------------------------------------------------------------------------------
/docker/hotswap-vm/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | docker build -t pingperf/java .
3 |
--------------------------------------------------------------------------------
/docker/meecrowave/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pingperf/java
2 | LABEL maintainer="hotswapagent.org" description="Meecrowave"
3 | ENV MEECROWAVE_ARCHIVE meecrowave-core-1.2.7-runner
4 | ENV INSTALL_DIR /opt
5 | RUN curl -o ${INSTALL_DIR}/${MEECROWAVE_ARCHIVE}.jar -L http://repo.maven.apache.org/maven2/org/apache/meecrowave/meecrowave-core/1.2.7/meecrowave-core-1.2.7-runner.jar
6 | ENV MEECROWAVE_HOME ${INSTALL_DIR}
7 | ENV DEPLOYMENT_DIR ${MEECROWAVE_HOME}
8 | ENTRYPOINT java ${JAVA_OPTS} -jar ${MEECROWAVE_ARCHIVE}.jar --webapp ${ARCHIVE_NAME} --context ${CONTEXT} ${APP_OPTS}
9 | WORKDIR ${INSTALL_DIR}
10 | EXPOSE 8080 8000
11 |
--------------------------------------------------------------------------------
/docker/meecrowave/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker build -t pingperf/meecrowave .
3 |
--------------------------------------------------------------------------------
/docker/openliberty-kernel/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pingperf/java
2 | LABEL maintainer="hotswapagent.org" description="OpenLiberty Kernel"
3 |
4 | ENV LIBERTY_VERSION 19.0.0.2
5 | ENV INSTALL_DIR /opt/ibm
6 |
7 | # Download OpenLiberty
8 | ENV OPENLIBERTY_HOME ${INSTALL_DIR}/openliberty-${LIBERTY_VERSION}
9 | ENV DEPLOYMENT_DIR ${OPENLIBERTY_HOME}/standalone/deployments/
10 | RUN curl -O https://repo1.maven.org/maven2/io/openliberty/openliberty-runtime/${LIBERTY_VERSION}/openliberty-runtime-${LIBERTY_VERSION}.zip \
11 | && unzip openliberty-runtime-${LIBERTY_VERSION}.zip -d ${INSTALL_DIR} \
12 | && rm openliberty-runtime-${LIBERTY_VERSION}.zip
13 | ENV PATH=/opt/ibm/wlp/bin:$PATH
14 |
15 | # Set Path Shortcuts
16 | ENV LOG_DIR=/logs \
17 | WLP_OUTPUT_DIR=/opt/ibm/wlp/output
18 |
19 | RUN mkdir /logs \
20 | && ln -s $WLP_OUTPUT_DIR/defaultServer /output \
21 | && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config
22 |
23 | # Configure WebSphere Liberty
24 | RUN /opt/ibm/wlp/bin/server create \
25 | && rm -rf $WLP_OUTPUT_DIR/.classCache /output/workarea
26 | COPY docker-server /opt/ibm/docker/
27 | RUN chmod a+x /opt/ibm/docker/docker-server
28 |
29 | EXPOSE 9080 9443
30 |
31 | CMD ["/opt/ibm/docker/docker-server", "run", "defaultServer"]
32 |
--------------------------------------------------------------------------------
/docker/openliberty-kernel/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker build -t pingperf/openliberty-kernel .
3 |
--------------------------------------------------------------------------------
/docker/openliberty-kernel/docker-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | keystorePath="/config/configDropins/defaults/keystore.xml"
4 |
5 | if [ ! -e $keystorePath ]
6 | then
7 | # Generate the keystore.xml
8 | PASSWORD=$(openssl rand -base64 32)
9 | XML=""
10 |
11 | # Create the keystore.xml file and place in configDropins
12 | mkdir -p $(dirname $keystorePath)
13 | echo $XML > $keystorePath
14 | fi
15 |
16 | # Pass on to the real server run
17 | exec /opt/ibm/wlp/bin/server $@
18 |
--------------------------------------------------------------------------------
/docker/openliberty-microprofile/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pingperf/openliberty-kernel
2 | LABEL maintainer="hotswapagent.org" description="Microprofile configuration"
3 | COPY server.xml /config/
4 |
--------------------------------------------------------------------------------
/docker/openliberty-microprofile/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker build -t pingperf/openliberty-microprofile .
3 |
--------------------------------------------------------------------------------
/docker/openliberty-microprofile/server.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | microProfile-1.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docker/payara-micro/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pingperf/java
2 | MAINTAINER hotswapagent.org
3 | ENV PAYARA_ARCHIVE payaramicro41
4 | ENV INSTALL_DIR /opt
5 | RUN curl -o ${INSTALL_DIR}/${PAYARA_ARCHIVE}.jar -L "https://search.maven.org/remotecontent?filepath=fish/payara/extras/payara-micro/5.191/payara-micro-5.191.jar"
6 | ENV PAYARA_HOME ${INSTALL_DIR}
7 | ENV DEPLOYMENT_DIR ${PAYARA_HOME}
8 | ENTRYPOINT java ${JAVA_OPTS} -jar ${PAYARA_ARCHIVE}.jar --deploy ${ARCHIVE_NAME} ${DEPLOY_OPTS}
9 | WORKDIR ${INSTALL_DIR}
10 | EXPOSE 8080 5900
11 |
--------------------------------------------------------------------------------
/docker/payara-micro/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker build -t pingperf/payara-micro .
3 |
--------------------------------------------------------------------------------
/docker/wildfly-hollow-swarm/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM pingperf/java
2 | LABEL maintainer="hotswapagent.org" description="Wildfly hollow swarm"
3 | ENV HOLLOWSWARM_ARCHIVE microprofile-2018.3.3-hollowswarm.jar
4 | ENV INSTALL_DIR /opt
5 | RUN curl -o ${INSTALL_DIR}/${HOLLOWSWARM_ARCHIVE}.jar -L http://repo2.maven.org/maven2/org/wildfly/swarm/servers/microprofile/2018.5.0/microprofile-2018.5.0-hollowswarm.jar
6 | ENV HOLLOWSWARM_HOME ${INSTALL_DIR}
7 | ENV DEPLOYMENT_DIR ${HOLLOWSWARM_HOME}
8 | ENTRYPOINT java ${JAVA_OPTS} -jar ${HOLLOWSWARM_ARCHIVE}.jar ${ARCHIVE_NAME} -b=0.0.0.0
9 | WORKDIR ${INSTALL_DIR}
10 | EXPOSE 8080 9990
11 |
--------------------------------------------------------------------------------
/docker/wildfly-hollow-swarm/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker build -t pingperf/wildfly-hollow-swarm .
3 |
--------------------------------------------------------------------------------
/dropwizard/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM hotswapagent/hotswap-vm
2 | VOLUME /tmp
3 | ARG JAR_FILE
4 | ADD ${JAR_FILE} app.jar
5 | ENTRYPOINT ["java","-Xmx128m","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar", "server"]
6 |
--------------------------------------------------------------------------------
/dropwizard/build-dropwizard.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && mvn dockerfile:build
3 |
--------------------------------------------------------------------------------
/dropwizard/dependency-reduced-pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | org.hotswap
5 | pingperf-dropwizard
6 | PingPerf-Dropwizard
7 | 1.0
8 |
9 |
10 |
11 |
12 | maven-clean-plugin
13 | 3.1.0
14 |
15 |
16 | maven-install-plugin
17 | 2.5.2
18 |
19 |
20 | maven-resources-plugin
21 | 3.1.0
22 |
23 |
24 | maven-enforcer-plugin
25 | 1.4.1
26 |
27 |
28 | maven-compiler-plugin
29 | 3.8.0
30 |
31 |
32 | maven-jar-plugin
33 | 3.1.1
34 |
35 |
36 |
37 |
38 |
39 | maven-jar-plugin
40 |
41 |
42 |
43 | true
44 | org.hotswap.test.dropwizard.ping.PingPerfApplication
45 |
46 |
47 |
48 |
49 |
50 | com.spotify
51 | dockerfile-maven-plugin
52 | 1.3.6
53 |
54 | pingperf-dropwizard
55 |
56 | target/${project.build.finalName}.jar
57 |
58 |
59 |
60 |
61 | maven-shade-plugin
62 | 3.1.0
63 |
64 |
65 | package
66 |
67 | shade
68 |
69 |
70 |
71 |
72 | ${exec.mainClass}
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | org.codehaus.mojo
82 | exec-maven-plugin
83 | 1.6.0
84 |
85 | java
86 |
87 | -classpath
88 |
89 | ${exec.mainClass}
90 |
91 |
92 |
93 |
94 |
95 |
96 | 1.3.9
97 | UTF-8
98 | 1.8
99 | UTF-8
100 | 1.8
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/dropwizard/example.yml:
--------------------------------------------------------------------------------
1 | server:
2 | requestLog:
3 | appenders: []
4 |
5 |
--------------------------------------------------------------------------------
/dropwizard/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | pingperf-dropwizard
6 | 1.0
7 | org.hotswap
8 | PingPerf-Dropwizard
9 |
10 |
11 | UTF-8
12 | UTF-8
13 | 1.8
14 | 1.8
15 | 1.3.9
16 |
17 |
18 |
19 |
20 | io.dropwizard
21 | dropwizard-core
22 | ${dropwizard.version}
23 |
24 |
25 | io.dropwizard
26 | dropwizard-auth
27 | ${dropwizard.version}
28 |
29 |
30 | io.dropwizard
31 | dropwizard-assets
32 | ${dropwizard.version}
33 |
34 |
35 | io.dropwizard
36 | dropwizard-http2
37 | ${dropwizard.version}
38 |
39 |
40 | io.dropwizard
41 | dropwizard-migrations
42 | ${dropwizard.version}
43 |
44 |
45 | io.dropwizard
46 | dropwizard-views-freemarker
47 | ${dropwizard.version}
48 |
49 |
50 | io.dropwizard
51 | dropwizard-views-mustache
52 | ${dropwizard.version}
53 |
54 |
55 | io.dropwizard
56 | dropwizard-metrics-graphite
57 | ${dropwizard.version}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | org.apache.maven.plugins
66 | maven-clean-plugin
67 | 3.1.0
68 |
69 |
70 | org.apache.maven.plugins
71 | maven-install-plugin
72 | 2.5.2
73 |
74 |
75 | org.apache.maven.plugins
76 | maven-resources-plugin
77 | 3.1.0
78 |
79 |
80 | org.apache.maven.plugins
81 | maven-enforcer-plugin
82 | 1.4.1
83 |
84 |
85 | org.apache.maven.plugins
86 | maven-compiler-plugin
87 | 3.8.0
88 |
89 |
90 | org.apache.maven.plugins
91 | maven-jar-plugin
92 | 3.1.1
93 |
94 |
95 |
96 |
97 |
98 | org.apache.maven.plugins
99 | maven-jar-plugin
100 |
101 |
102 |
103 | true
104 | org.hotswap.test.dropwizard.ping.PingPerfApplication
105 |
106 |
107 |
108 |
109 |
110 | com.spotify
111 | dockerfile-maven-plugin
112 | 1.3.6
113 |
114 | pingperf-dropwizard
115 |
116 | target/${project.build.finalName}.jar
117 |
118 |
119 |
120 |
121 |
122 | org.apache.maven.plugins
123 | maven-shade-plugin
124 | 3.1.0
125 |
126 |
127 | package
128 |
129 | shade
130 |
131 |
132 |
133 |
134 | ${exec.mainClass}
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 | org.codehaus.mojo
144 | exec-maven-plugin
145 | 1.6.0
146 |
147 | java
148 |
149 | -classpath
150 |
151 | ${exec.mainClass}
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
--------------------------------------------------------------------------------
/dropwizard/run-dropwizard.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-dropwizard
3 |
--------------------------------------------------------------------------------
/dropwizard/src/main/java/org/hotswap/test/dropwizard/ping/PingPerfApplication.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.dropwizard.ping;
2 |
3 | import io.dropwizard.Application;
4 | import io.dropwizard.setup.Bootstrap;
5 | import io.dropwizard.setup.Environment;
6 |
7 | public class PingPerfApplication extends Application {
8 | public static void main(String[] args) throws Exception {
9 | new PingPerfApplication().run(args);
10 | }
11 |
12 | @Override
13 | public String getName() {
14 | return "pingperf-dropwizard";
15 | }
16 |
17 | @Override
18 | public void initialize(Bootstrap bootstrap) {
19 | }
20 |
21 | @Override
22 | public void run(PingPerfConfiguration configuration, Environment environment) {
23 | environment.jersey().register(new PingResource());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/dropwizard/src/main/java/org/hotswap/test/dropwizard/ping/PingPerfConfiguration.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.dropwizard.ping;
2 |
3 | import io.dropwizard.Configuration;
4 |
5 | public class PingPerfConfiguration extends Configuration {
6 | }
7 |
--------------------------------------------------------------------------------
/dropwizard/src/main/java/org/hotswap/test/dropwizard/ping/PingResource.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.dropwizard.ping;
2 |
3 | import javax.inject.Inject;
4 | import javax.ws.rs.GET;
5 | import javax.ws.rs.Path;
6 | import javax.ws.rs.Produces;
7 | import javax.ws.rs.core.MediaType;
8 | import javax.ws.rs.core.Response;
9 |
10 | @Path("ping")
11 | public class PingResource {
12 |
13 | //@Inject
14 | private Statistics statistics;
15 |
16 | @GET
17 | @Produces(MediaType.TEXT_PLAIN)
18 | @Path("simple")
19 | public Response getSimple() {
20 | //statistics.updateStatistic(0);
21 | return Response.ok().build();
22 | }
23 | }
--------------------------------------------------------------------------------
/dropwizard/src/main/java/org/hotswap/test/dropwizard/ping/Statistics.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.dropwizard.ping;
2 |
3 | import javax.inject.Singleton;
4 |
5 | @Singleton
6 | public class Statistics {
7 | public void test() {
8 | }
9 | }
--------------------------------------------------------------------------------
/jmeter_50users.jmx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | false
7 | true
8 | false
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | continue
17 | 1
18 | 0
19 | 50
20 | 0
21 | 1
22 |
23 | 0
24 | 60
25 | 0
26 |
27 | false
28 | -1
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 127.0.0.1
37 | 8080
38 | http
39 |
40 | /ping/simple
41 | GET
42 | true
43 | false
44 | true
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 | false
53 |
54 | saveConfig
55 |
56 |
57 | true
58 | true
59 | true
60 |
61 | true
62 | true
63 | true
64 | true
65 | false
66 | true
67 | true
68 | false
69 | false
70 | false
71 | true
72 | false
73 | false
74 | false
75 | true
76 | 0
77 | true
78 | true
79 | true
80 | true
81 | true
82 |
83 |
84 |
85 |
86 |
87 |
88 | false
89 |
90 | saveConfig
91 |
92 |
93 | true
94 | true
95 | true
96 |
97 | true
98 | true
99 | true
100 | true
101 | false
102 | true
103 | true
104 | false
105 | false
106 | false
107 | true
108 | false
109 | false
110 | false
111 | true
112 | 0
113 | true
114 | true
115 | true
116 | true
117 | true
118 |
119 |
120 |
121 | 1000
122 | false
123 |
124 |
125 |
126 |
127 | false
128 | false
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/micronaut/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM hotswapagent/hotswap-vm
2 | VOLUME /tmp
3 | ARG JAR_FILE
4 | ADD ${JAR_FILE} app.jar
5 | ENTRYPOINT ["java","-Xmx128m","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/micronaut/build-micronaut.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && mvn dockerfile:build
3 |
--------------------------------------------------------------------------------
/micronaut/dependency-reduced-pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | hotswap.org
5 | pingperf-micronaut
6 | 1.0
7 |
8 |
9 |
10 |
11 | maven-compiler-plugin
12 | 3.7.0
13 |
14 |
15 | test-compile
16 |
17 | testCompile
18 |
19 |
20 |
21 | -parameters
22 |
23 |
24 |
25 | io.micronaut
26 | micronaut-inject-java
27 | ${micronaut.version}
28 |
29 |
30 |
31 |
32 |
33 |
34 | ${jdk.version}
35 | ${jdk.version}
36 |
37 | -parameters
38 |
39 |
40 |
41 | io.micronaut
42 | micronaut-inject-java
43 | ${micronaut.version}
44 |
45 |
46 | io.micronaut.configuration
47 | micronaut-openapi
48 | ${micronaut.version}
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | com.spotify
58 | dockerfile-maven-plugin
59 | 1.3.6
60 |
61 | pingperf-micronaut
62 |
63 | target/${project.build.finalName}.jar
64 |
65 |
66 |
67 |
68 | maven-surefire-plugin
69 | 2.19.1
70 |
71 |
72 | org.junit.platform
73 | junit-platform-surefire-provider
74 | 1.1.0
75 |
76 |
77 | org.junit.jupiter
78 | junit-jupiter-engine
79 | 5.1.0
80 |
81 |
82 |
83 |
84 | maven-shade-plugin
85 | 3.1.0
86 |
87 |
88 | package
89 |
90 | shade
91 |
92 |
93 |
94 |
95 | ${exec.mainClass}
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | org.codehaus.mojo
105 | exec-maven-plugin
106 | 1.6.0
107 |
108 | java
109 |
110 | -classpath
111 |
112 | ${exec.mainClass}
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | jcenter.bintray.com
121 | https://jcenter.bintray.com
122 |
123 |
124 |
125 |
126 | io.micronaut
127 | micronaut-inject-java
128 | 1.0.3
129 | provided
130 |
131 |
132 | io.micronaut.test
133 | micronaut-test-junit5
134 | 1.0.1
135 | test
136 |
137 |
138 | micronaut-test-core
139 | io.micronaut.test
140 |
141 |
142 | junit-jupiter-api
143 | org.junit.jupiter
144 |
145 |
146 |
147 |
148 | org.junit.jupiter
149 | junit-jupiter-engine
150 | 5.1.0
151 | test
152 |
153 |
154 | apiguardian-api
155 | org.apiguardian
156 |
157 |
158 | junit-platform-engine
159 | org.junit.platform
160 |
161 |
162 | junit-jupiter-api
163 | org.junit.jupiter
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | io.micronaut
172 | micronaut-bom
173 | ${micronaut.version}
174 | pom
175 | import
176 |
177 |
178 |
179 |
180 | 1.8
181 | org.hotswap.test.micronaut.Application
182 | 1.0.3
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/micronaut/micronaut-cli.yml:
--------------------------------------------------------------------------------
1 | profile: service
2 | defaultPackage: foo
3 | ---
4 | testFramework: junit
5 | sourceLanguage: java
--------------------------------------------------------------------------------
/micronaut/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with 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,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven2 Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59 | if [ -z "$JAVA_HOME" ]; then
60 | if [ -x "/usr/libexec/java_home" ]; then
61 | export JAVA_HOME="`/usr/libexec/java_home`"
62 | else
63 | export JAVA_HOME="/Library/Java/Home"
64 | fi
65 | fi
66 | ;;
67 | esac
68 |
69 | if [ -z "$JAVA_HOME" ] ; then
70 | if [ -r /etc/gentoo-release ] ; then
71 | JAVA_HOME=`java-config --jre-home`
72 | fi
73 | fi
74 |
75 | if [ -z "$M2_HOME" ] ; then
76 | ## resolve links - $0 may be a link to maven's home
77 | PRG="$0"
78 |
79 | # need this for relative symlinks
80 | while [ -h "$PRG" ] ; do
81 | ls=`ls -ld "$PRG"`
82 | link=`expr "$ls" : '.*-> \(.*\)$'`
83 | if expr "$link" : '/.*' > /dev/null; then
84 | PRG="$link"
85 | else
86 | PRG="`dirname "$PRG"`/$link"
87 | fi
88 | done
89 |
90 | saveddir=`pwd`
91 |
92 | M2_HOME=`dirname "$PRG"`/..
93 |
94 | # make it fully qualified
95 | M2_HOME=`cd "$M2_HOME" && pwd`
96 |
97 | cd "$saveddir"
98 | # echo Using m2 at $M2_HOME
99 | fi
100 |
101 | # For Cygwin, ensure paths are in UNIX format before anything is touched
102 | if $cygwin ; then
103 | [ -n "$M2_HOME" ] &&
104 | M2_HOME=`cygpath --unix "$M2_HOME"`
105 | [ -n "$JAVA_HOME" ] &&
106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107 | [ -n "$CLASSPATH" ] &&
108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109 | fi
110 |
111 | # For Mingw, ensure paths are in UNIX format before anything is touched
112 | if $mingw ; then
113 | [ -n "$M2_HOME" ] &&
114 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
115 | [ -n "$JAVA_HOME" ] &&
116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117 | # TODO classpath?
118 | fi
119 |
120 | if [ -z "$JAVA_HOME" ]; then
121 | javaExecutable="`which javac`"
122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123 | # readlink(1) is not available as standard on Solaris 10.
124 | readLink=`which readlink`
125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126 | if $darwin ; then
127 | javaHome="`dirname \"$javaExecutable\"`"
128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129 | else
130 | javaExecutable="`readlink -f \"$javaExecutable\"`"
131 | fi
132 | javaHome="`dirname \"$javaExecutable\"`"
133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134 | JAVA_HOME="$javaHome"
135 | export JAVA_HOME
136 | fi
137 | fi
138 | fi
139 |
140 | if [ -z "$JAVACMD" ] ; then
141 | if [ -n "$JAVA_HOME" ] ; then
142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143 | # IBM's JDK on AIX uses strange locations for the executables
144 | JAVACMD="$JAVA_HOME/jre/sh/java"
145 | else
146 | JAVACMD="$JAVA_HOME/bin/java"
147 | fi
148 | else
149 | JAVACMD="`which java`"
150 | fi
151 | fi
152 |
153 | if [ ! -x "$JAVACMD" ] ; then
154 | echo "Error: JAVA_HOME is not defined correctly." >&2
155 | echo " We cannot execute $JAVACMD" >&2
156 | exit 1
157 | fi
158 |
159 | if [ -z "$JAVA_HOME" ] ; then
160 | echo "Warning: JAVA_HOME environment variable is not set."
161 | fi
162 |
163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164 |
165 | # traverses directory structure from process work directory to filesystem root
166 | # first directory with .mvn subdirectory is considered project base directory
167 | find_maven_basedir() {
168 |
169 | if [ -z "$1" ]
170 | then
171 | echo "Path not specified to find_maven_basedir"
172 | return 1
173 | fi
174 |
175 | basedir="$1"
176 | wdir="$1"
177 | while [ "$wdir" != '/' ] ; do
178 | if [ -d "$wdir"/.mvn ] ; then
179 | basedir=$wdir
180 | break
181 | fi
182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183 | if [ -d "${wdir}" ]; then
184 | wdir=`cd "$wdir/.."; pwd`
185 | fi
186 | # end of workaround
187 | done
188 | echo "${basedir}"
189 | }
190 |
191 | # concatenates all lines of a file
192 | concat_lines() {
193 | if [ -f "$1" ]; then
194 | echo "$(tr -s '\n' ' ' < "$1")"
195 | fi
196 | }
197 |
198 | BASE_DIR=`find_maven_basedir "$(pwd)"`
199 | if [ -z "$BASE_DIR" ]; then
200 | exit 1;
201 | fi
202 |
203 | ##########################################################################################
204 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
205 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
206 | ##########################################################################################
207 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
208 | if [ "$MVNW_VERBOSE" = true ]; then
209 | echo "Found .mvn/wrapper/maven-wrapper.jar"
210 | fi
211 | else
212 | if [ "$MVNW_VERBOSE" = true ]; then
213 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
214 | fi
215 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
216 | while IFS="=" read key value; do
217 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
218 | esac
219 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
220 | if [ "$MVNW_VERBOSE" = true ]; then
221 | echo "Downloading from: $jarUrl"
222 | fi
223 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
224 |
225 | if command -v wget > /dev/null; then
226 | if [ "$MVNW_VERBOSE" = true ]; then
227 | echo "Found wget ... using wget"
228 | fi
229 | wget "$jarUrl" -O "$wrapperJarPath"
230 | elif command -v curl > /dev/null; then
231 | if [ "$MVNW_VERBOSE" = true ]; then
232 | echo "Found curl ... using curl"
233 | fi
234 | curl -o "$wrapperJarPath" "$jarUrl"
235 | else
236 | if [ "$MVNW_VERBOSE" = true ]; then
237 | echo "Falling back to using Java to download"
238 | fi
239 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
240 | if [ -e "$javaClass" ]; then
241 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
242 | if [ "$MVNW_VERBOSE" = true ]; then
243 | echo " - Compiling MavenWrapperDownloader.java ..."
244 | fi
245 | # Compiling the Java class
246 | ("$JAVA_HOME/bin/javac" "$javaClass")
247 | fi
248 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
249 | # Running the downloader
250 | if [ "$MVNW_VERBOSE" = true ]; then
251 | echo " - Running MavenWrapperDownloader.java ..."
252 | fi
253 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
254 | fi
255 | fi
256 | fi
257 | fi
258 | ##########################################################################################
259 | # End of extension
260 | ##########################################################################################
261 |
262 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
263 | if [ "$MVNW_VERBOSE" = true ]; then
264 | echo $MAVEN_PROJECTBASEDIR
265 | fi
266 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
267 |
268 | # For Cygwin, switch paths to Windows format before running java
269 | if $cygwin; then
270 | [ -n "$M2_HOME" ] &&
271 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
272 | [ -n "$JAVA_HOME" ] &&
273 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
274 | [ -n "$CLASSPATH" ] &&
275 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
276 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
277 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
278 | fi
279 |
280 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
281 |
282 | exec "$JAVACMD" \
283 | $MAVEN_OPTS \
284 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
285 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
287 |
--------------------------------------------------------------------------------
/micronaut/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with 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,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
126 | )
127 |
128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130 | if exist %WRAPPER_JAR% (
131 | echo Found %WRAPPER_JAR%
132 | ) else (
133 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
134 | echo Downloading from: %DOWNLOAD_URL%
135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136 | echo Finished downloading %WRAPPER_JAR%
137 | )
138 | @REM End of extension
139 |
140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141 | if ERRORLEVEL 1 goto error
142 | goto end
143 |
144 | :error
145 | set ERROR_CODE=1
146 |
147 | :end
148 | @endlocal & set ERROR_CODE=%ERROR_CODE%
149 |
150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154 | :skipRcPost
155 |
156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
158 |
159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160 |
161 | exit /B %ERROR_CODE%
162 |
--------------------------------------------------------------------------------
/micronaut/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | hotswap.org
4 | pingperf-micronaut
5 | 1.0
6 |
7 | org.hotswap.test.micronaut.Application
8 | 1.0.3
9 | 1.8
10 |
11 |
12 |
13 | jcenter.bintray.com
14 | https://jcenter.bintray.com
15 |
16 |
17 |
18 |
19 |
20 | io.micronaut
21 | micronaut-bom
22 | ${micronaut.version}
23 | pom
24 | import
25 |
26 |
27 |
28 |
29 |
30 | io.micronaut
31 | micronaut-http-client
32 | compile
33 |
34 |
35 | io.micronaut
36 | micronaut-http-server-netty
37 | compile
38 |
39 |
40 | io.micronaut
41 | micronaut-inject
42 | compile
43 |
44 |
45 | io.micronaut
46 | micronaut-runtime
47 | compile
48 |
49 |
50 | io.micronaut.configuration
51 | micronaut-hibernate-validator
52 | compile
53 |
54 |
55 | io.swagger.core.v3
56 | swagger-annotations
57 | compile
58 |
59 |
60 | io.micronaut
61 | micronaut-inject-java
62 | provided
63 |
64 |
65 | ch.qos.logback
66 | logback-classic
67 | 1.2.3
68 | runtime
69 |
70 |
71 | io.micronaut.test
72 | micronaut-test-junit5
73 | 1.0.1
74 | test
75 |
76 |
77 | org.junit.jupiter
78 | junit-jupiter-engine
79 | 5.1.0
80 | test
81 |
82 |
83 |
84 |
85 |
86 | com.spotify
87 | dockerfile-maven-plugin
88 | 1.3.6
89 |
90 | pingperf-micronaut
91 |
92 | target/${project.build.finalName}.jar
93 |
94 |
95 |
96 |
97 | org.apache.maven.plugins
98 | maven-surefire-plugin
99 | 2.19.1
100 |
101 |
102 | org.junit.platform
103 | junit-platform-surefire-provider
104 | 1.1.0
105 |
106 |
107 | org.junit.jupiter
108 | junit-jupiter-engine
109 | 5.1.0
110 |
111 |
112 |
113 |
114 | org.apache.maven.plugins
115 | maven-shade-plugin
116 | 3.1.0
117 |
118 |
119 | package
120 |
121 | shade
122 |
123 |
124 |
125 |
126 | ${exec.mainClass}
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | org.codehaus.mojo
136 | exec-maven-plugin
137 | 1.6.0
138 |
139 | java
140 |
141 | -classpath
142 |
143 | ${exec.mainClass}
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | org.apache.maven.plugins
152 | maven-compiler-plugin
153 | 3.7.0
154 |
155 | ${jdk.version}
156 | ${jdk.version}
157 |
158 | -parameters
159 |
160 |
161 |
162 | io.micronaut
163 | micronaut-inject-java
164 | ${micronaut.version}
165 |
166 |
167 | io.micronaut.configuration
168 | micronaut-openapi
169 | ${micronaut.version}
170 |
171 |
172 |
173 |
174 |
175 | test-compile
176 |
177 | testCompile
178 |
179 |
180 |
181 | -parameters
182 |
183 |
184 |
185 | io.micronaut
186 | micronaut-inject-java
187 | ${micronaut.version}
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
--------------------------------------------------------------------------------
/micronaut/run-mikronaut.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-micronaut
3 |
--------------------------------------------------------------------------------
/micronaut/src/main/java/org/hotswap/test/micronaut/Application.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.micronaut;
2 |
3 | import io.micronaut.runtime.Micronaut;
4 | import io.swagger.v3.oas.annotations.ExternalDocumentation;
5 | import io.swagger.v3.oas.annotations.OpenAPIDefinition;
6 | import io.swagger.v3.oas.annotations.info.Contact;
7 | import io.swagger.v3.oas.annotations.info.Info;
8 | import io.swagger.v3.oas.annotations.info.License;
9 | import io.swagger.v3.oas.annotations.security.SecurityRequirement;
10 | import io.swagger.v3.oas.annotations.servers.Server;
11 | import io.swagger.v3.oas.annotations.servers.ServerVariable;
12 | import io.swagger.v3.oas.annotations.tags.Tag;
13 | /**
14 | * @author graemerocher
15 | * @since 1.0
16 | */
17 | @OpenAPIDefinition(
18 | info = @Info(
19 | title = "the title",
20 | version = "0.0",
21 | description = "My API",
22 | license = @License(name = "Apache 2.0", url = "http://foo.bar"),
23 | contact = @Contact(url = "http://gigantic-server.com", name = "Fred", email = "Fred@gigagantic-server.com")
24 | ),
25 | tags = {
26 | @Tag(name = "Tag 1", description = "desc 1", externalDocs = @ExternalDocumentation(description = "docs desc")),
27 | @Tag(name = "Tag 2", description = "desc 2", externalDocs = @ExternalDocumentation(description = "docs desc 2")),
28 | @Tag(name = "Tag 3")
29 | },
30 | externalDocs = @ExternalDocumentation(description = "definition docs desc"),
31 | security = {
32 | @SecurityRequirement(name = "req 1", scopes = {"a", "b"}),
33 | @SecurityRequirement(name = "req 2", scopes = {"b", "c"})
34 | },
35 | servers = {
36 | @Server(
37 | description = "server 1",
38 | url = "http://foo",
39 | variables = {
40 | @ServerVariable(name = "var1", description = "var 1", defaultValue = "1", allowableValues = {"1", "2"}),
41 | @ServerVariable(name = "var2", description = "var 2", defaultValue = "1", allowableValues = {"1", "2"})
42 | })
43 | }
44 | )
45 | public class Application {
46 |
47 | public static void main(String[] args) {
48 | Micronaut.run(Application.class);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/micronaut/src/main/java/org/hotswap/test/micronaut/PingController.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.micronaut;
2 |
3 | import javax.inject.Inject;
4 |
5 | import io.micronaut.http.MediaType;
6 | import io.micronaut.http.annotation.Controller;
7 | import io.micronaut.http.annotation.Get;
8 | import io.micronaut.validation.Validated;
9 | import io.reactivex.Single;
10 |
11 | @Controller("/")
12 | @Validated
13 | public class PingController {
14 |
15 | @Inject
16 | Statistics statistics;;
17 |
18 | @Get(uri = "/simple", produces = MediaType.TEXT_PLAIN)
19 | public Single hello() {
20 | return Single.just("ok");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/micronaut/src/main/java/org/hotswap/test/micronaut/Statistics.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.micronaut;
2 |
3 | import javax.inject.Singleton;
4 |
5 | @Singleton
6 | public class Statistics {
7 | public void test() {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/micronaut/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | micronaut.application.name=hello-world
2 | micronaut.router.static-resources.swagger.enabled=true
3 | micronaut.router.static-resources.swagger.paths=classpath:META-INF/swagger
4 | micronaut.router.static-resources.swagger.mapping=/swagger/**
5 |
6 | # Uncomment the following lines to enable Consul support
7 | #consul.client.config.enabled=true
8 | #consul.client.config.format=properties
9 | #consul.client.defaultZone=${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}
10 |
11 | # Uncomment the following lines to enable zipkin tracing
12 | #tracing.zipkin.enabled=true
13 | #tracing.zipkin.http.url=http://localhost:9411
14 | #tracing.zipkin.sampler.probability=1
15 |
16 | # Uncomment the following lines to enable Jaeger tracing
17 | #tracing.jaeger.enabled=true
18 | #tracing.jaeger.sampler.probability=1
19 |
--------------------------------------------------------------------------------
/micronaut/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/microprofile/Dockerfile.meecrowave:
--------------------------------------------------------------------------------
1 | FROM pingperf/meecrowave
2 | COPY ./target/pingperf.war ${DEPLOYMENT_DIR}
3 | ENV ARCHIVE_NAME pingperf.war
4 | ENV CONTEXT pingperf
5 | ENV APP_OPTS --cdi-conversation=false
6 | ENV JAVA_OPTS="-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Xmx128m -Djava.net.preferIPv4Stack=true"
7 |
--------------------------------------------------------------------------------
/microprofile/Dockerfile.openliberty-micro:
--------------------------------------------------------------------------------
1 | FROM pingperf/openliberty-microprofile
2 | ENV DEPLOYMENT_DIR /config/dropins/
3 | COPY ./target/pingperf.war ${DEPLOYMENT_DIR}
4 | COPY ./liberty.jvm.options /config/jvm.options
5 |
--------------------------------------------------------------------------------
/microprofile/Dockerfile.payara-micro:
--------------------------------------------------------------------------------
1 | FROM pingperf/payara-micro
2 | COPY ./target/pingperf.war ${DEPLOYMENT_DIR}
3 | ENV ARCHIVE_NAME pingperf.war
4 | ENV JAVA_OPTS "-Xmx128m"
5 | ENV DEPLOY_OPTS "--nocluster"
6 |
--------------------------------------------------------------------------------
/microprofile/Dockerfile.wildfly-hollow-swarm:
--------------------------------------------------------------------------------
1 | FROM pingperf/wildfly-hollow-swarm
2 | COPY ./target/pingperf.war ${DEPLOYMENT_DIR}
3 | ENV JAVA_OPTS "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Xmx128m"
4 | ENV ARCHIVE_NAME pingperf.war
5 |
--------------------------------------------------------------------------------
/microprofile/build-meecrowave.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && docker build -f Dockerfile.meecrowave -t pingperf-meecrowave .
3 |
--------------------------------------------------------------------------------
/microprofile/build-openliberty-micro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && docker build -f Dockerfile.openliberty-micro -t pingperf-openliberty-micro .
3 |
--------------------------------------------------------------------------------
/microprofile/build-payara-micro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && docker build -f Dockerfile.payara-micro -t pingperf-payara-micro .
3 |
--------------------------------------------------------------------------------
/microprofile/build-wildfly-hollow-swarm.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && docker build -f Dockerfile.wildfly-hollow-swarm -t pingperf-wildfly-hollow-swarm .
3 |
--------------------------------------------------------------------------------
/microprofile/jmeter_50users.jmx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | false
7 | true
8 | false
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | continue
17 | 50
18 | 0
19 | 50
20 | 0
21 | 1
22 |
23 | 0
24 | 60
25 | 0
26 |
27 | false
28 | -1
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 127.0.0.1
37 | 8080
38 | http
39 |
40 | /pingperf/ping/simple
41 | GET
42 | true
43 | false
44 | true
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 | false
53 |
54 | saveConfig
55 |
56 |
57 | true
58 | true
59 | true
60 |
61 | true
62 | true
63 | true
64 | true
65 | false
66 | true
67 | true
68 | false
69 | false
70 | false
71 | true
72 | false
73 | false
74 | false
75 | true
76 | 0
77 | true
78 | true
79 | true
80 | true
81 | true
82 |
83 |
84 |
85 |
86 |
87 |
88 | false
89 |
90 | saveConfig
91 |
92 |
93 | true
94 | true
95 | true
96 |
97 | true
98 | true
99 | true
100 | true
101 | false
102 | true
103 | true
104 | false
105 | false
106 | false
107 | true
108 | false
109 | false
110 | false
111 | true
112 | 0
113 | true
114 | true
115 | true
116 | true
117 | true
118 |
119 |
120 |
121 | 1000
122 | false
123 |
124 |
125 |
126 |
127 | false
128 | false
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/microprofile/jmeter_50users_spring-boot.jmx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | false
7 | true
8 | false
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | continue
17 | 1
18 | 0
19 | 50
20 | 0
21 | 1
22 |
23 | 0
24 | 60
25 | 0
26 |
27 | false
28 | -1
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 127.0.0.1
37 | 8080
38 | http
39 |
40 | /simple
41 | GET
42 | true
43 | false
44 | true
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 | false
53 |
54 | saveConfig
55 |
56 |
57 | true
58 | true
59 | true
60 |
61 | true
62 | true
63 | true
64 | true
65 | false
66 | true
67 | true
68 | false
69 | false
70 | false
71 | true
72 | false
73 | false
74 | false
75 | true
76 | 0
77 | true
78 | true
79 | true
80 | true
81 | true
82 |
83 |
84 |
85 |
86 |
87 |
88 | false
89 |
90 | saveConfig
91 |
92 |
93 | true
94 | true
95 | true
96 |
97 | true
98 | true
99 | true
100 | true
101 | false
102 | true
103 | true
104 | false
105 | false
106 | false
107 | true
108 | false
109 | false
110 | false
111 | true
112 | 0
113 | true
114 | true
115 | true
116 | true
117 | true
118 |
119 |
120 |
121 | 1000
122 | false
123 |
124 |
125 |
126 |
127 | false
128 | false
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/microprofile/liberty.jvm.options:
--------------------------------------------------------------------------------
1 | # Set the maximum heap size to 1024m.
2 | -Xmx128m
3 |
--------------------------------------------------------------------------------
/microprofile/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | com.airhacks
4 | pingperf
5 | 0.0.4-SNAPSHOT
6 | war
7 |
8 |
9 | javax
10 | javaee-api
11 | 7.0
12 | provided
13 |
14 |
15 |
16 | pingperf
17 |
18 |
19 | 1.8
20 | 1.8
21 | false
22 |
23 |
24 |
--------------------------------------------------------------------------------
/microprofile/run-meecrowave.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-meecrowave
3 |
--------------------------------------------------------------------------------
/microprofile/run-openliberty-micro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm --network host pingperf-openliberty-micro
3 |
--------------------------------------------------------------------------------
/microprofile/run-payara-micro.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-payara-micro
3 |
--------------------------------------------------------------------------------
/microprofile/run-wildfly-hollow-swarm.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 -p 9990:9990 --network host pingperf-wildfly-hollow-swarm
3 |
4 |
--------------------------------------------------------------------------------
/microprofile/src/main/java/org/hotswap/test/jaxrs/ping/PingResource.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.jaxrs.ping;
2 |
3 | import javax.inject.Inject;
4 | import javax.ws.rs.GET;
5 | import javax.ws.rs.Path;
6 | import javax.ws.rs.Produces;
7 | import javax.ws.rs.core.MediaType;
8 | import javax.ws.rs.core.Response;
9 |
10 | @Path("ping")
11 | public class PingResource {
12 |
13 | @Inject
14 | private Statistics statistics;
15 |
16 | @GET
17 | @Produces(MediaType.TEXT_PLAIN)
18 | @Path("simple")
19 | public Response getSimple() {
20 | //statistics.updateStatistic(0);
21 | return Response.ok().build();
22 | }
23 | }
--------------------------------------------------------------------------------
/microprofile/src/main/java/org/hotswap/test/jaxrs/ping/RESTConfiguration.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.jaxrs.ping;
2 |
3 | import javax.ws.rs.ApplicationPath;
4 | import javax.ws.rs.core.Application;
5 |
6 | @ApplicationPath("")
7 | public class RESTConfiguration extends Application {
8 |
9 | }
--------------------------------------------------------------------------------
/microprofile/src/main/java/org/hotswap/test/jaxrs/ping/Statistics.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.jaxrs.ping;
2 |
3 | import javax.enterprise.context.ApplicationScoped;
4 |
5 | @ApplicationScoped
6 | public class Statistics {
7 | public void test() {
8 | }
9 | }
--------------------------------------------------------------------------------
/microprofile/src/main/webapp/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/microprofile/src/main/webapp/META-INF/context.xml:
--------------------------------------------------------------------------------
1 |
2 | <_/>
3 |
--------------------------------------------------------------------------------
/microprofile/src/main/webapp/WEB-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/quarkus/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/quarkus/Dockerfile.quarkus-jvm:
--------------------------------------------------------------------------------
1 | FROM hotswapagent/hotswap-vm
2 | COPY ./target/pingperf-runner.jar /work/application.jar
3 | COPY ./target/lib /work/lib
4 | ENV JAVA_OPTS "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Xmx128m"
5 | ENTRYPOINT java ${JAVA_OPTS} -cp /work/application -jar /work/application.jar
6 | WORKDIR /opt
7 | EXPOSE 8080 8000
8 |
--------------------------------------------------------------------------------
/quarkus/Dockerfile.quarkus-native:
--------------------------------------------------------------------------------
1 | FROM registry.fedoraproject.org/fedora-minimal
2 | WORKDIR /work/
3 | COPY target/*-runner /work/application
4 | RUN chmod 775 /work
5 | EXPOSE 8080
6 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0", "-Xmx128m", "-Xms25m", "-Xmn100m"]
7 |
--------------------------------------------------------------------------------
/quarkus/build-quarkus-jvm.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn package && docker build -f Dockerfile.quarkus-jvm -t pingperf-quarkus-jvm .
3 |
--------------------------------------------------------------------------------
/quarkus/build-quarkus-native.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn package -Pnative -Dnative-image.docker-build=true && docker build -f Dockerfile.quarkus-native -t pingperf-quarkus-native .
3 |
4 |
--------------------------------------------------------------------------------
/quarkus/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | org.acme
6 | pingperf-quarkus
7 | 1.0-SNAPSHOT
8 |
9 |
10 | 0.12.0
11 | 2.22.0
12 | UTF-8
13 | 1.8
14 | 1.8
15 |
16 |
17 |
18 |
19 |
20 | io.quarkus
21 | quarkus-bom
22 | ${quarkus.version}
23 | pom
24 | import
25 |
26 |
27 |
28 |
29 |
30 | pingperf
31 |
32 |
33 | maven-surefire-plugin
34 | ${surefire.version}
35 |
36 |
37 | org.jboss.logmanager.LogManager
38 |
39 |
40 |
41 |
42 | io.quarkus
43 | quarkus-maven-plugin
44 | ${quarkus.version}
45 |
46 |
47 |
48 | build
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | io.quarkus
59 | quarkus-vertx
60 |
61 |
62 | io.quarkus
63 | quarkus-vertx-web
64 |
65 |
66 |
67 | io.quarkus
68 | quarkus-junit5
69 |
70 |
71 | io.rest-assured
72 | rest-assured
73 | 3.3.0
74 | test
75 |
76 |
77 |
78 |
79 |
80 | native
81 |
82 |
83 |
84 | io.quarkus
85 | quarkus-maven-plugin
86 | ${quarkus.version}
87 |
88 |
89 |
90 | native-image
91 |
92 |
93 | true
94 |
95 |
96 |
97 |
98 |
99 |
100 | org.apache.maven.plugins
101 | maven-failsafe-plugin
102 | ${surefire.version}
103 |
104 |
105 |
106 | integration-test
107 | verify
108 |
109 |
110 |
111 | ${project.build.directory}/${project.build.finalName}-runner
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/quarkus/run-quarkus-boot-jvm.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-quarkus-jvm
3 |
--------------------------------------------------------------------------------
/quarkus/run-quarkus-boot-native.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-quarkus-native
3 |
--------------------------------------------------------------------------------
/quarkus/src/main/java/hotswap/test/jaxrs/ping/PingResource.java:
--------------------------------------------------------------------------------
1 | package hotswap.test.jaxrs.ping;
2 |
3 | import io.quarkus.vertx.web.Route;
4 | import io.vertx.ext.web.RoutingContext;
5 |
6 | import javax.inject.Inject;
7 |
8 | import static io.vertx.core.http.HttpMethod.GET;
9 |
10 | public class PingResource {
11 |
12 | @Inject
13 | private Statistics statistics;
14 |
15 | @Route(path = "/ping/simple", methods = GET)
16 | void getSimple(RoutingContext context) {
17 | //statistics.updateStatistic(0);
18 | context.response().setStatusCode(200).end();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/quarkus/src/main/java/hotswap/test/jaxrs/ping/Statistics.java:
--------------------------------------------------------------------------------
1 | package hotswap.test.jaxrs.ping;
2 |
3 | import javax.annotation.PostConstruct;
4 | import javax.enterprise.context.ApplicationScoped;
5 |
6 | @ApplicationScoped
7 | public class Statistics {
8 |
9 | public void test() {
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.ear
17 | *.zip
18 | *.tar.gz
19 | *.rar
20 |
21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22 | hs_err_pid*
23 | /target/
24 |
--------------------------------------------------------------------------------
/spring-boot/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM hotswapagent/hotswap-vm
2 | VOLUME /tmp
3 | ARG JAR_FILE
4 | ADD ${JAR_FILE} app.jar
5 | ENTRYPOINT ["java","-Xmx128m","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/spring-boot/README.md:
--------------------------------------------------------------------------------
1 | ( (
2 | )\ ) )\ ) (
3 | (()/( ( ( ( (()/( ( ( )\ )
4 | /(_)))\ ( )\))( /(_)) ))\ )( (()/(
5 | (_)) ((_) )\ ) ((_))\ (_)) /((_)(()\ /(_))
6 | | _ \ (_) _(_/( (()(_)| _ \(_)) ((_)(_) _|
7 | | _/ | || ' \))/ _` | | _// -_) | '_| | _|
8 | |_| |_||_||_| \__, | |_| \___| |_| |_|
9 | |___/
10 |
11 | # Performance tests of java [MicroProfiles](https://microprofile.io/)
12 |
13 | ## Motivation
14 |
15 | Docker based comparision of SpringBoot with JavaEE MicroProfiles. JavaEE Microprofile application is available in project [pingperf](https://github.com/HotswapProjects/pingperf).
16 |
17 | ## Quick start
18 |
19 | * run `build-spring-boot.sh` to build docker image.
20 | * send REST requests as fast as possible (in single thread) : `./perf-utils/echo_test.py`
21 | * monitor performance : `watch "docker stats --no-stream --no-trunc && echo && ./perf-utils/ping_statistics.py"`
22 |
23 | ## Results
24 |
25 | Results are available at http://github.com/HotswapProjects/pingperf/blob/master/README.md
26 |
--------------------------------------------------------------------------------
/spring-boot/build-spring-boot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn clean package && mvn dockerfile:build
3 |
--------------------------------------------------------------------------------
/spring-boot/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework
7 | pingperf-spring-boot
8 | 0.1.0
9 | jar
10 | Pingperf Spring Boot
11 |
12 |
13 | org.springframework.boot
14 | spring-boot-starter-parent
15 | 2.1.3.RELEASE
16 |
17 |
18 |
19 |
20 |
21 | 1.8
22 |
23 |
24 |
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-maven-plugin
29 |
30 |
31 |
32 | com.spotify
33 | dockerfile-maven-plugin
34 | 1.3.6
35 |
36 | pingperf-spring-boot
37 |
38 | target/${project.build.finalName}.jar
39 |
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-dependency-plugin
47 |
48 |
49 | unpack
50 | package
51 |
52 | unpack
53 |
54 |
55 |
56 |
57 | ${project.groupId}
58 | ${project.artifactId}
59 | ${project.version}
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | org.springframework.boot
72 | spring-boot-starter-web
73 |
74 |
75 | org.springframework.boot
76 | spring-boot-starter-test
77 | test
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/spring-boot/run-spring-boot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-spring-boot
3 |
--------------------------------------------------------------------------------
/spring-boot/src/main/java/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/spring-boot/src/main/java/org/hotswap/test/springboot/Application.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.springboot;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @SpringBootApplication
10 | @RestController
11 | public class Application {
12 |
13 | @Autowired
14 | private Statistics statistics;
15 |
16 | @RequestMapping("/simple")
17 | public String home() {
18 | //statistics.updateStatistic(0);
19 | return "ok";
20 | }
21 |
22 | public static void main(String[] args) {
23 | SpringApplication.run(Application.class, args);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/spring-boot/src/main/java/org/hotswap/test/springboot/Statistics.java:
--------------------------------------------------------------------------------
1 | package org.hotswap.test.springboot;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | @Service
6 | public class Statistics {
7 | public void test() {
8 | }
9 | }
--------------------------------------------------------------------------------
/spring-boot/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8080
3 |
4 | #TODO: figure out why I need this here and in bootstrap.yml
5 | spring:
6 | application:
7 | name: testLatticeApp
8 |
9 | ribbon:
10 | ServerListRefreshInterval: 1000
11 |
12 | endpoints:
13 | health:
14 | sensitive: false
15 | restart:
16 | enabled: true
17 | shutdown:
18 | enabled: true
19 |
--------------------------------------------------------------------------------
/vertx/Dockerfile.vertx:
--------------------------------------------------------------------------------
1 | FROM hotswapagent/hotswap-vm
2 | COPY ./target/vertx-*.jar /work/application.jar
3 | ENV JAVA_OPTS "$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Xmx128m"
4 | ENTRYPOINT java ${JAVA_OPTS} -cp /work/application -jar /work/application.jar
5 | WORKDIR /opt
6 | EXPOSE 8080 8000
7 |
--------------------------------------------------------------------------------
/vertx/build-vertx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn package && docker build -f Dockerfile.vertx -t pingperf-vertx .
3 |
--------------------------------------------------------------------------------
/vertx/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 | pingperf
8 | vertx
9 | 0.0.1-SNAPSHOT
10 |
11 | pingperf
12 |
13 |
14 | pingperf.Main
15 |
16 | UTF-8
17 | 1.8
18 | 1.8
19 | 1.8
20 | 1.8
21 |
22 |
23 |
24 |
25 |
26 | io.vertx
27 | vertx-stack-depchain
28 | 3.7.0
29 | pom
30 | import
31 |
32 |
33 |
34 |
35 |
36 |
37 | io.vertx
38 | vertx-core
39 |
40 |
41 |
42 |
43 |
44 |
45 | io.reactiverse
46 | vertx-maven-plugin
47 | 1.0.18
48 |
49 |
50 | vmp
51 |
52 | initialize
53 | package
54 |
55 |
56 |
57 |
58 | true
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/vertx/run-vertx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | docker run -ti --rm -p 8080:8080 --network host pingperf-vertx
3 |
--------------------------------------------------------------------------------
/vertx/src/main/java/pingperf/Main.java:
--------------------------------------------------------------------------------
1 | package pingperf;
2 |
3 | import io.vertx.core.AbstractVerticle;
4 |
5 | public class Main extends AbstractVerticle {
6 |
7 | @Override
8 | public void start() {
9 | vertx
10 | .createHttpServer()
11 | .requestHandler(req -> {
12 | if ("/simple".equals(req.path())) {
13 | req.response()
14 | .end();
15 | } else {
16 | req.response()
17 | .setStatusCode(404)
18 | .end();
19 | }
20 | })
21 | .listen(8080);
22 | }
23 |
24 | }
--------------------------------------------------------------------------------