diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a45642 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +build/ +.idea/ +.gradle/ +.classpath +.project +.settings/ +.idea/ +.java-version +build-eclipse/ +/tags +out/ +setenv.sh + +.DS_store +*.iml +*.ipr +*.iws +*.swp +*.log +*.patch +*.diff +*.dat +*.rej +*.orig diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ee0d96 --- /dev/null +++ b/README.md @@ -0,0 +1,1409 @@ +# Spring Boot Data Geode Example + +## Description +This is an example of a Spring Boot Data Geode client. + +It uses: + +- SB 2.2.2.RELEASE +- SBDG 1.2.2.RELEASE +- GEODE 1.9.2 +- GemFire 9.8.4 + +## Deploy Application +### PCFOne +#### Build Application +Build the application jar using **gradlew** like: + +``` +./gradlew clean jar bootJar + +> Task :client:compileJava +Note: Some input files use unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. + +> Task :server:compileJava +Note: Some input files use unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. + +Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. +Use '--warning-mode all' to show the individual deprecation warnings. +See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings + +BUILD SUCCESSFUL in 8s +13 actionable tasks: 13 executed +``` +#### Push Client Application +Push the client application using **cf push** like: + +``` +cf push -f client/manifest.yml +Pushing from manifest to org pivot-boglesby / space playground as boglesby@pivotal.io... +Using manifest file client/manifest.yml +Getting app info... +Updating app with these attributes... + name: sdgApp + path: /Users/boglesby/Dev/Tests/spring-boot/pcc-long-running-test/client/build/libs/client-0.0.1-SNAPSHOT.jar + buildpacks: + https://github.com/cloudfoundry/java-buildpack.git + command: JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext -Djava.security.properties=$PWD/.java-buildpack/java_security/java.security $JAVA_OPTS" && CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-3.13.0_RELEASE -totMemory=$MEMORY_LIMIT -loadedClasses=23795 -poolType=metaspace -stackThreads=250 -vmOptions="$JAVA_OPTS") && echo JVM Memory Configuration: $CALCULATED_MEMORY && JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY" && MALLOC_ARENA_MAX=2 SERVER_PORT=$PORT eval exec $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp $PWD/. org.springframework.boot.loader.JarLauncher + disk quota: 1G + health check type: port + instances: 1 + memory: 768M + stack: cflinuxfs3 + services: + pccService + routes: + sdgapp.apps.pcfone.io + +Updating app sdgApp... +Mapping routes... +Comparing local files to remote cache... +Packaging files to upload... +Uploading files... + 793.77 KiB / 793.77 KiB [==========================================] 100.00% 2s + +Waiting for API to complete processing files... + +Stopping app... + +Staging app and tracing logs... + Cell c1dffb38-7389-46f7-9c3a-8a8fb57af8b4 creating container for instance 452c0370-e11f-47f1-a20b-5ce1903b196a + Cell c1dffb38-7389-46f7-9c3a-8a8fb57af8b4 successfully created container for instance 452c0370-e11f-47f1-a20b-5ce1903b196a + Downloading app package... + Downloading build artifacts cache... + Downloaded build artifacts cache (42M) + Downloaded app package (67.4M) + -----> Java Buildpack 6fea4d5 | https://github.com/cloudfoundry/java-buildpack.git#6fea4d5 + -----> Downloading Jvmkill Agent 1.16.0_RELEASE from https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/jvmkill-1.16.0-RELEASE.so (found in cache) + -----> Downloading Open Jdk JRE 1.8.0_232 from https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/openjdk-jre-1.8.0_232-bionic.tar.gz (found in cache) + Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s) + JVM DNS caching disabled in lieu of BOSH DNS caching + -----> Downloading Open JDK Like Memory Calculator 3.13.0_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/bionic/x86_64/memory-calculator-3.13.0-RELEASE.tar.gz (found in cache) + Loaded Classes: 23014, Threads: 250 + -----> Downloading Client Certificate Mapper 1.11.0_RELEASE from https://java-buildpack.cloudfoundry.org/client-certificate-mapper/client-certificate-mapper-1.11.0-RELEASE.jar (found in cache) + -----> Downloading Container Security Provider 1.16.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-security-provider/container-security-provider-1.16.0-RELEASE.jar (found in cache) + -----> Downloading Spring Auto Reconfiguration 2.11.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-2.11.0-RELEASE.jar (found in cache) + Exit status 0 + Uploading droplet, build artifacts cache... + Uploading droplet... + Uploading build artifacts cache... + Uploaded build artifacts cache (42M) + Uploaded droplet (109.6M) + Uploading complete + Cell c1dffb38-7389-46f7-9c3a-8a8fb57af8b4 stopping instance 452c0370-e11f-47f1-a20b-5ce1903b196a + Cell c1dffb38-7389-46f7-9c3a-8a8fb57af8b4 destroying container for instance 452c0370-e11f-47f1-a20b-5ce1903b196a + Cell c1dffb38-7389-46f7-9c3a-8a8fb57af8b4 successfully destroyed container for instance 452c0370-e11f-47f1-a20b-5ce1903b196a + +Waiting for app to start... + +name: sdgApp +requested state: started +isolation segment: iso-01 +routes: sdgapp.apps.pcfone.io +last uploaded: Fri 03 Jan 16:02:05 PST 2020 +stack: cflinuxfs3 +buildpacks: https://github.com/cloudfoundry/java-buildpack.git + +type: web +instances: 1/1 +memory usage: 768M +start command: JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 + -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) + -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext + -Djava.security.properties=$PWD/.java-buildpack/java_security/java.security + $JAVA_OPTS" && + CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-3.13.0_RELEASE + -totMemory=$MEMORY_LIMIT -loadedClasses=23795 + -poolType=metaspace -stackThreads=250 -vmOptions="$JAVA_OPTS") + && echo JVM Memory Configuration: $CALCULATED_MEMORY && + JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY" && MALLOC_ARENA_MAX=2 + SERVER_PORT=$PORT eval exec + $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp + $PWD/. org.springframework.boot.loader.JarLauncher + state since cpu memory disk details +#0 running 2020-01-04T00:02:26Z 0.0% 224M of 768M 183.8M of 1G +``` +#### Push CQ Client Application +Push the CQ client application using **cf push** like: + +``` +cf push -f client_cq/manifest.yml +Pushing from manifest to org pivot-boglesby / space playground as boglesby@pivotal.io... +Using manifest file client_cq/manifest.yml +Getting app info... +Updating app with these attributes... + name: clientCqApp + path: /Users/boglesby/Dev/Tests/spring-boot/pcc-long-running-test/client_cq/build/libs/client_cq-0.0.1-SNAPSHOT.jar + buildpacks: + https://github.com/cloudfoundry/java-buildpack.git + command: JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext -Djava.security.properties=$PWD/.java-buildpack/java_security/java.security $JAVA_OPTS" && CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-3.13.0_RELEASE -totMemory=$MEMORY_LIMIT -loadedClasses=23790 -poolType=metaspace -stackThreads=250 -vmOptions="$JAVA_OPTS") && echo JVM Memory Configuration: $CALCULATED_MEMORY && JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY" && MALLOC_ARENA_MAX=2 SERVER_PORT=$PORT eval exec $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp $PWD/. org.springframework.boot.loader.JarLauncher + disk quota: 1G + health check type: port + instances: 1 + memory: 768M + stack: cflinuxfs3 + services: + pccService + routes: + clientcqapp.apps.pcfone.io + +Updating app clientCqApp... +Mapping routes... +Comparing local files to remote cache... +Packaging files to upload... +Uploading files... + 772.39 KiB / 772.39 KiB [==========================================] 100.00% 2s + +Waiting for API to complete processing files... + +Stopping app... + +Staging app and tracing logs... + Cell 8851f31c-1d22-48d4-b987-839b9a8db015 creating container for instance 4baa38e6-438c-4b3e-8fbd-68d19a0b2e18 + Cell 8851f31c-1d22-48d4-b987-839b9a8db015 successfully created container for instance 4baa38e6-438c-4b3e-8fbd-68d19a0b2e18 + Downloading app package... + Downloading build artifacts cache... + Downloaded build artifacts cache (42M) + Downloaded app package (67.4M) + -----> Java Buildpack 6fea4d5 | https://github.com/cloudfoundry/java-buildpack.git#6fea4d5 + -----> Downloading Jvmkill Agent 1.16.0_RELEASE from https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/jvmkill-1.16.0-RELEASE.so (found in cache) + -----> Downloading Open Jdk JRE 1.8.0_232 from https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/openjdk-jre-1.8.0_232-bionic.tar.gz (found in cache) + Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s) + JVM DNS caching disabled in lieu of BOSH DNS caching + -----> Downloading Open JDK Like Memory Calculator 3.13.0_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/bionic/x86_64/memory-calculator-3.13.0-RELEASE.tar.gz (found in cache) + Loaded Classes: 23009, Threads: 250 + -----> Downloading Client Certificate Mapper 1.11.0_RELEASE from https://java-buildpack.cloudfoundry.org/client-certificate-mapper/client-certificate-mapper-1.11.0-RELEASE.jar (found in cache) + -----> Downloading Container Security Provider 1.16.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-security-provider/container-security-provider-1.16.0-RELEASE.jar (found in cache) + -----> Downloading Spring Auto Reconfiguration 2.11.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-2.11.0-RELEASE.jar (found in cache) + Exit status 0 + Uploading droplet, build artifacts cache... + Uploading droplet... + Uploading build artifacts cache... + Uploaded build artifacts cache (42M) + Uploaded droplet (109.6M) + Uploading complete + Cell 8851f31c-1d22-48d4-b987-839b9a8db015 stopping instance 4baa38e6-438c-4b3e-8fbd-68d19a0b2e18 + Cell 8851f31c-1d22-48d4-b987-839b9a8db015 destroying container for instance 4baa38e6-438c-4b3e-8fbd-68d19a0b2e18 + Cell 8851f31c-1d22-48d4-b987-839b9a8db015 successfully destroyed container for instance 4baa38e6-438c-4b3e-8fbd-68d19a0b2e18 + +Waiting for app to start... + +name: clientCqApp +requested state: started +isolation segment: iso-01 +routes: clientcqapp.apps.pcfone.io +last uploaded: Fri 03 Jan 16:05:13 PST 2020 +stack: cflinuxfs3 +buildpacks: https://github.com/cloudfoundry/java-buildpack.git + +type: web +instances: 1/1 +memory usage: 768M +start command: JAVA_OPTS="-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 + -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) + -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext + -Djava.security.properties=$PWD/.java-buildpack/java_security/java.security + $JAVA_OPTS" && + CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-3.13.0_RELEASE + -totMemory=$MEMORY_LIMIT -loadedClasses=23790 + -poolType=metaspace -stackThreads=250 -vmOptions="$JAVA_OPTS") + && echo JVM Memory Configuration: $CALCULATED_MEMORY && + JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY" && MALLOC_ARENA_MAX=2 + SERVER_PORT=$PORT eval exec + $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp + $PWD/. org.springframework.boot.loader.JarLauncher + state since cpu memory disk details +#0 running 2020-01-04T00:05:35Z 0.0% 178.2M of 768M 183.6M of 1G +``` +#### Get Client Application Logs +##### Get latest Logs +Get the latest client application log messages using the **cf logs** command like: + +``` +cf logs sdgApp --recent +... + 2019-12-19T16:20:09.95-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:20:09.955 INFO 33 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' + 2019-12-19T16:20:09.96-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:20:09.960 INFO 33 --- [ main] io.pivotal.test.client.Client : Started Client in 7.316 seconds (JVM running for 8.365) + 2019-12-19T16:20:10.01-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:20:10.017 INFO 33 --- [ main] io.pivotal.test.client.Client : Client Command Line Arguments: [] + 2019-12-19T16:20:11.67-0800 [CELL/0] OUT Container became healthy +``` +##### Tail Logs +Tail the client application log messages using the **cf logs** command like: + +``` +cf logs sdgApp +Retrieving logs for app sdgApp in org pivot-boglesby / space playground as boglesby@pivotal.io... +``` +#### Get CQ Client Application Logs +##### Get latest Logs +Get the latest CQ client application log messages using the **cf logs** command like: + +``` +cf logs clientCqApp --recent +... + 2020-01-03T16:05:32.66-0800 [APP/PROC/WEB/0] OUT 2020-01-04 00:05:32.664 INFO 14 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' + 2020-01-03T16:05:32.66-0800 [APP/PROC/WEB/0] OUT 2020-01-04 00:05:32.669 INFO 14 --- [ main] io.pivotal.test.client.Client : Started Client in 7.769 seconds (JVM running for 8.694) + 2020-01-03T16:05:33.97-0800 [CELL/0] OUT Container became healthy +``` +##### Tail Logs +Tail the CQ client application log messages using the **cf logs** command like: + +``` +cf logs clientCqApp +Retrieving logs for app sdgApp in org pivot-boglesby / space playground as boglesby@pivotal.io... +``` +## Run Clients +### PCFOne +#### REST +##### Put Command +Run the put command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/put/10/1024 +{"operation":"put","status":"SUCCESS","completionTime":191} +``` +The application will log messages like: + +``` + 2019-12-19T16:45:46.45-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.457 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Putting 10 trades of size 1024 bytes + 2019-12-19T16:45:46.51-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.517 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=0, cusip=HD, shares=55, price=371.99) + 2019-12-19T16:45:46.52-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.524 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=1, cusip=SAP, shares=98, price=544.99) + 2019-12-19T16:45:46.53-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.531 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=2, cusip=UPS, shares=39, price=114.47) + 2019-12-19T16:45:46.54-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.548 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=3, cusip=HD, shares=77, price=613.03) + 2019-12-19T16:45:46.56-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.560 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=4, cusip=MMM, shares=59, price=671.10) + 2019-12-19T16:45:46.57-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.570 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=5, cusip=BUD, shares=92, price=226.78) + 2019-12-19T16:45:46.59-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.589 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=6, cusip=AVGO, shares=6, price=321.33) + 2019-12-19T16:45:46.59-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.592 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=7, cusip=AMZN, shares=26, price=908.64) + 2019-12-19T16:45:46.64-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.645 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=8, cusip=AXP, shares=69, price=911.00) + 2019-12-19T16:45:46.64-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.648 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Saved Trade(id=9, cusip=TM, shares=72, price=975.52) + 2019-12-19T16:45:46.64-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:45:46.649 INFO 33 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Put 10 trades of size 1024 bytes in 191 ms +``` +###### Get Command +Run the get command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/get/10 +{"operation":"get","status":"SUCCESS","completionTime":55} +``` +The application will log messages like: + +``` + 2019-12-19T16:47:42.28-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.286 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Getting 10 trades + 2019-12-19T16:47:42.31-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.318 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=0, cusip=HD, shares=55, price=371.99) + 2019-12-19T16:47:42.32-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.326 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=1, cusip=SAP, shares=98, price=544.99) + 2019-12-19T16:47:42.32-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.327 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=2, cusip=UPS, shares=39, price=114.47) + 2019-12-19T16:47:42.32-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.329 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=3, cusip=HD, shares=77, price=613.03) + 2019-12-19T16:47:42.33-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.330 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=4, cusip=MMM, shares=59, price=671.10) + 2019-12-19T16:47:42.33-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.331 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=5, cusip=BUD, shares=92, price=226.78) + 2019-12-19T16:47:42.33-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.338 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=6, cusip=AVGO, shares=6, price=321.33) + 2019-12-19T16:47:42.33-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.339 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=7, cusip=AMZN, shares=26, price=908.64) + 2019-12-19T16:47:42.34-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.340 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=8, cusip=AXP, shares=69, price=911.00) + 2019-12-19T16:47:42.34-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.341 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got Trade(id=9, cusip=TM, shares=72, price=975.52) + 2019-12-19T16:47:42.34-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:47:42.341 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Got 10 trades in 55 ms +``` +##### Destroy Command +Run the destroy command using **curl** like: + +``` +curl -X DELETE https://sdgapp.apps.pcfone.io/trades/destroy/10 +{"operation":"destroy","status":"SUCCESS","completionTime":63} +``` +The application will log messages like: + +``` + 2019-12-19T16:48:10.72-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.719 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroying 10 trades + 2019-12-19T16:48:10.73-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.735 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=0 + 2019-12-19T16:48:10.74-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.740 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=1 + 2019-12-19T16:48:10.75-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.750 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=2 + 2019-12-19T16:48:10.75-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.758 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=3 + 2019-12-19T16:48:10.76-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.761 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=4 + 2019-12-19T16:48:10.76-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.765 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=5 + 2019-12-19T16:48:10.76-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.768 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=6 + 2019-12-19T16:48:10.77-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.779 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=7 + 2019-12-19T16:48:10.78-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.781 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=8 + 2019-12-19T16:48:10.78-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.783 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed key=9 + 2019-12-19T16:48:10.78-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:48:10.783 INFO 33 --- [nio-8080-exec-2] i.p.test.client.service.TradeService : Destroyed 10 trades in 63 ms +``` +##### Query By Cusip Command +Run the query by cusip command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/querybycusip/10 +``` +The application will log messages like: + +``` + 2019-12-19T16:49:04.52-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:04.529 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Executing 10 cusip queries + 2019-12-19T16:49:04.79-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:04.797 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1803 trades for cusip=FB + 2019-12-19T16:49:04.96-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:04.959 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1848 trades for cusip=AAPL + 2019-12-19T16:49:05.04-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.049 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1889 trades for cusip=ADBE + 2019-12-19T16:49:05.11-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.110 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1838 trades for cusip=AVGO + 2019-12-19T16:49:05.25-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.259 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1832 trades for cusip=CRM + 2019-12-19T16:49:05.41-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.414 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1801 trades for cusip=SAP + 2019-12-19T16:49:05.52-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.523 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1826 trades for cusip=XOM + 2019-12-19T16:49:05.58-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.580 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1886 trades for cusip=GE + 2019-12-19T16:49:05.64-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.642 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1879 trades for cusip=NKE + 2019-12-19T16:49:05.70-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.705 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Returned 1886 trades for cusip=GE + 2019-12-19T16:49:05.70-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:49:05.705 INFO 33 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Executed 10 cusip queries in 1176 ms +``` +##### Function Update Command +Run the function update command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/functionupdate/10 +{"operation":"functionupdate","status":"SUCCESS","completionTime":65} +``` +The application will log messages like: + +``` + 2019-12-19T16:50:12.12-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.125 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updating 10 trades with function + 2019-12-19T16:50:12.14-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.149 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 0 result=[true] + 2019-12-19T16:50:12.16-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.164 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 1 result=[true] + 2019-12-19T16:50:12.16-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.167 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 2 result=[true] + 2019-12-19T16:50:12.17-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.174 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 3 result=[true] + 2019-12-19T16:50:12.17-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.176 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 4 result=[true] + 2019-12-19T16:50:12.17-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.179 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 5 result=[true] + 2019-12-19T16:50:12.18-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.181 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 6 result=[true] + 2019-12-19T16:50:12.18-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.186 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 7 result=[true] + 2019-12-19T16:50:12.18-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.188 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 8 result=[true] + 2019-12-19T16:50:12.19-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.190 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated trade 9 result=[true] + 2019-12-19T16:50:12.19-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:50:12.190 INFO 33 --- [io-8080-exec-10] i.p.test.client.service.TradeService : Updated 10 trades with function in 65 ms +``` +##### Put Forever Command +Run the function update command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/putforever/10/1024 +``` +The application will log messages like: + +``` +... +``` +##### Get Forever Command +Run the function update command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/getforever/10 +``` +The application will log messages like: + +``` +... +``` +##### Destroy Forever Command +Run the function update command using **curl** like: + +``` +curl -X DELETE https://sdgapp.apps.pcfone.io/trades/destroyforever/10 +``` +The application will log messages like: + +``` +... +``` +##### Query by Cusip Forever Command +Run the function update command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/querybycusipforever +``` +The application will log messages like: + +``` +... +``` +##### Function Update Forever Command +Run the function update command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/functionupdateforever/10 +``` +The application will log messages like: + +``` +... +``` +##### Multi-threaded Put Forever Command +Run the multi-threaded put forever command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/putforever/10/1024/5 +``` +The application will log messages like: + +``` +... +``` +##### Multi-threaded Get Forever Command +Run the multi-threaded get forever command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/getforever/10/5 +``` +The application will log messages like: + +``` +... +``` +##### Multi-threaded Destroy Forever Command +Run the multi-threaded destroy forever command using **curl** like: + +``` +curl -X DELETE https://sdgapp.apps.pcfone.io/trades/destroyforever/10/5 +``` +The application will log messages like: + +``` +... +``` +##### Multi-threaded Query by Cusip Forever Command +Run the multi-threaded query by cusip forever command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/querybycusipforever/5 +``` +The application will log messages like: + +``` +... +``` +##### Multi-threaded Function Update Forever Command +Run the multi-threaded function update command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/functionupdateforever/10/5 +``` +The application will log messages like: + +``` +... +``` +##### Get One Command +Run the get one command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/getone/0 +``` +The application will log messages like: + +``` +``` +##### Query One By Cusip Command +Run the query one by cusip command using **curl** like: + +``` +curl https://sdgapp.apps.pcfone.io/trades/queryonebycusip/AAPL +``` +The application will log messages like: + +``` +``` +##### Test Command +Run the test command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/starttest/100000/1024 +[{"operation":"putforever","status":"SUCCESS","completionTime":0},{"operation":"getforever","status":"SUCCESS","completionTime":0},{"operation":"querybycusipforever","status":"SUCCESS","completionTime":0},{"operation":"functionupdateforever","status":"SUCCESS","completionTime":0}] +``` +The application will log messages like: + +``` + 2019-12-19T16:55:37.45-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:37.450 INFO 33 --- [ Thread-12] i.p.test.client.service.TradeService : Putting 10000 trades of size 1024 bytes forever + 2019-12-19T16:55:37.45-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:37.451 INFO 33 --- [ Thread-13] i.p.test.client.service.TradeService : Getting 100000 trades forever + 2019-12-19T16:55:37.45-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:37.452 INFO 33 --- [ Thread-14] i.p.test.client.service.TradeService : Executing cusip queries forever + 2019-12-19T16:55:37.45-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:37.458 INFO 33 --- [ Thread-15] i.p.test.client.service.TradeService : Updating 100000 trades with function forever + 2019-12-19T16:55:50.19-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:50.194 INFO 33 --- [ Thread-13] i.p.test.client.service.TradeService : Got 10000 trades in 12743 ms + 2019-12-19T16:55:55.83-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:55.830 INFO 33 --- [ Thread-12] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 18379 ms + 2019-12-19T16:55:56.82-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:56.822 INFO 33 --- [ Thread-15] i.p.test.client.service.TradeService : Updated 10000 trades with function in 19364 ms + 2019-12-19T16:55:59.66-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:55:59.662 INFO 33 --- [ Thread-13] i.p.test.client.service.TradeService : Got 20000 trades in 9468 ms + 2019-12-19T16:56:11.27-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:56:11.274 INFO 33 --- [ Thread-13] i.p.test.client.service.TradeService : Got 30000 trades in 11612 ms + 2019-12-19T16:56:11.96-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:56:11.960 INFO 33 --- [ Thread-12] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 16130 ms + 2019-12-19T16:56:13.96-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:56:13.966 INFO 33 --- [ Thread-15] i.p.test.client.service.TradeService : Updated 20000 trades with function in 17143 ms + 2019-12-19T16:56:25.74-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:56:25.742 INFO 33 --- [ Thread-12] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 13781 ms + 2019-12-19T16:56:29.08-0800 [APP/PROC/WEB/0] OUT 2019-12-20 00:56:29.085 INFO 33 --- [ Thread-15] i.p.test.client.service.TradeService : Updated 30000 trades with function in 15118 ms + 2019-12-19T17:03:56.82-0800 [APP/PROC/WEB/0] OUT 2019-12-20 01:03:56.829 INFO 33 --- [ Thread-14] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 499377 ms + 2019-12-19T17:12:08.31-0800 [APP/PROC/WEB/0] OUT 2019-12-20 01:12:08.314 INFO 33 --- [ Thread-14] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 491485 ms + 2019-12-19T17:20:22.31-0800 [APP/PROC/WEB/0] OUT 2019-12-20 01:20:22.310 INFO 33 --- [ Thread-14] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 493995 ms +... +``` +##### Stop Operations Command +Run the stop operations command using **curl** like: + +``` +curl -X POST https://sdgapp.apps.pcfone.io/trades/stopoperations +``` +The application will log messages like: + +``` +``` +### Local +#### Java +##### Put Command +Run the put command using the **runclient.sh** script like: + +``` +./runclient.sh put 10 1024 +... +2019-12-18 15:55:16.285 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Putting 10 trades of size 1024 bytes +2019-12-18 15:55:16.324 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=0, cusip=BA, shares=66, price=217.50) +2019-12-18 15:55:16.330 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=1, cusip=JPM, shares=87, price=182.33) +2019-12-18 15:55:16.337 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=2, cusip=SAP, shares=87, price=415.07) +2019-12-18 15:55:16.344 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=3, cusip=CMCSA, shares=70, price=972.59) +2019-12-18 15:55:16.347 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=4, cusip=AAPL, shares=93, price=315.32) +2019-12-18 15:55:16.351 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=5, cusip=JNJ, shares=90, price=404.47) +2019-12-18 15:55:16.356 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=6, cusip=HSBC, shares=64, price=879.82) +2019-12-18 15:55:16.363 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=7, cusip=COST, shares=48, price=378.87) +2019-12-18 15:55:16.367 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=8, cusip=ORCL, shares=3, price=882.84) +2019-12-18 15:55:16.371 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Saved Trade(id=9, cusip=SAP, shares=15, price=384.58) +2019-12-18 15:55:16.371 INFO 95421 --- [ main] i.p.test.client.service.TradeService : Put 10 trades of size 1024 bytes in 86 ms +``` +###### Get Command +Run the get command using the **runclient.sh** script like: + +``` +./runclient.sh get 10 +... +2019-12-18 16:16:11.679 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Getting 10 trades +2019-12-18 16:16:11.720 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=0, cusip=BA, shares=66, price=217.50) +2019-12-18 16:16:11.721 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=1, cusip=JPM, shares=87, price=182.33) +2019-12-18 16:16:11.725 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=2, cusip=SAP, shares=87, price=415.07) +2019-12-18 16:16:11.730 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=3, cusip=CMCSA, shares=70, price=972.59) +2019-12-18 16:16:11.731 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=4, cusip=AAPL, shares=93, price=315.32) +2019-12-18 16:16:11.732 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=5, cusip=JNJ, shares=90, price=404.47) +2019-12-18 16:16:11.733 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=6, cusip=HSBC, shares=64, price=879.82) +2019-12-18 16:16:11.738 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=7, cusip=COST, shares=48, price=378.87) +2019-12-18 16:16:11.740 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=8, cusip=ORCL, shares=3, price=882.84) +2019-12-18 16:16:11.741 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=9, cusip=SAP, shares=15, price=384.58) +2019-12-18 16:16:11.741 INFO 96776 --- [ main] i.p.test.client.service.TradeService : Got 10 trades in 62 ms +``` +##### Destroy Command +Run the destroy command using the **runclient.sh** script like: + +``` +./runclient.sh destroy 10 +... +2019-12-18 16:19:30.910 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroying 10 trades +2019-12-18 16:19:30.937 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=0 +2019-12-18 16:19:30.950 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=1 +2019-12-18 16:19:30.956 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=2 +2019-12-18 16:19:30.962 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=3 +2019-12-18 16:19:30.964 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=4 +2019-12-18 16:19:30.968 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=5 +2019-12-18 16:19:30.970 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=6 +2019-12-18 16:19:30.976 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=7 +2019-12-18 16:19:30.979 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=8 +2019-12-18 16:19:30.982 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed key=9 +2019-12-18 16:19:30.982 INFO 97101 --- [ main] i.p.test.client.service.TradeService : Destroyed 10 trades in 71 ms +``` +##### Query By Cusip Command +Run the query by cusip command using the **runclient.sh** script like: + +``` +./runclient.sh querybycusip 10 +... +2019-12-18 16:20:58.897 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Executing 10 cusip queries +2019-12-18 16:20:59.000 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 2 trades for cusip=HON +2019-12-18 16:20:59.007 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 2 trades for cusip=PYPL +2019-12-18 16:20:59.016 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 4 trades for cusip=GE +2019-12-18 16:20:59.041 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 3 trades for cusip=ORCL +2019-12-18 16:20:59.048 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 1 trades for cusip=LMT +2019-12-18 16:20:59.055 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 3 trades for cusip=JPM +2019-12-18 16:20:59.063 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 4 trades for cusip=CSCO +2019-12-18 16:20:59.071 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 2 trades for cusip=BAC +2019-12-18 16:20:59.078 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 3 trades for cusip=JPM +2019-12-18 16:20:59.084 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Returned 4 trades for cusip=GE +2019-12-18 16:20:59.084 INFO 97261 --- [ main] i.p.test.client.service.TradeService : Executed 10 cusip queries in 187 ms +``` +##### Function Update Command +Run the function update command using the **runclient.sh** script like: + +``` +./runclient.sh functionupdate 10 +... +2019-12-19 15:36:02.235 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updating 10 trades with function +2019-12-19 15:36:02.368 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 0 result=[true] +2019-12-19 15:36:02.484 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 1 result=[true] +2019-12-19 15:36:02.520 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 2 result=[true] +2019-12-19 15:36:02.556 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 3 result=[true] +2019-12-19 15:36:02.575 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 4 result=[true] +2019-12-19 15:36:02.596 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 5 result=[true] +2019-12-19 15:36:02.596 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 6 result=[true] +2019-12-19 15:36:02.636 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 7 result=[true] +2019-12-19 15:36:02.661 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 8 result=[true] +2019-12-19 15:36:02.683 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated trade 9 result=[true] +2019-12-19 15:36:02.683 INFO 57857 --- [ main] i.p.test.client.service.TradeService : Updated 10 trades with function in 448 ms +``` +##### Put Forever Command +Run the put forever command using the **runclient.sh** script like: + +``` +./runclient.sh putforever 10 1024 +... +2019-12-18 16:25:13.375 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:25:26.151 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 12776 ms +2019-12-18 16:25:33.715 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 7564 ms +2019-12-18 16:25:39.731 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 6016 ms +2019-12-18 16:25:45.077 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 40000 trades of size 1024 bytes in 5346 ms +2019-12-18 16:25:50.076 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 50000 trades of size 1024 bytes in 4999 ms +2019-12-18 16:25:55.212 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 60000 trades of size 1024 bytes in 5135 ms +2019-12-18 16:26:00.291 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 70000 trades of size 1024 bytes in 5078 ms +2019-12-18 16:26:05.810 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 80000 trades of size 1024 bytes in 5519 ms +2019-12-18 16:26:10.709 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 90000 trades of size 1024 bytes in 4899 ms +2019-12-18 16:26:15.723 INFO 97527 --- [ main] i.p.test.client.service.TradeService : Put 100000 trades of size 1024 bytes in 5014 ms +... +``` +##### Get Forever Command +Run the get forever command using the **runclient.sh** script like: + +``` +./runclient.sh getforever 10 +... +2019-12-18 16:28:41.760 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:28:43.031 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 10000 trades in 1271 ms +2019-12-18 16:28:43.892 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 20000 trades in 861 ms +2019-12-18 16:28:44.760 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 30000 trades in 868 ms +2019-12-18 16:28:45.509 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 40000 trades in 749 ms +2019-12-18 16:28:46.274 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 50000 trades in 765 ms +2019-12-18 16:28:47.087 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 60000 trades in 812 ms +2019-12-18 16:28:47.808 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 70000 trades in 721 ms +2019-12-18 16:28:48.550 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 80000 trades in 742 ms +2019-12-18 16:28:49.301 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 90000 trades in 750 ms +2019-12-18 16:28:50.037 INFO 97736 --- [ main] i.p.test.client.service.TradeService : Got 100000 trades in 736 ms +... +``` +##### Destroy Forever Command +Run the destroy forever command using the **runclient.sh** script like: + +``` +./runclient.sh destroyforever 10 +... +2019-12-18 16:31:22.751 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:31:23.175 INFO 97971 --- [Timer-DEFAULT-3] o.a.g.internal.admin.ClientStatsManager : ClientStatsManager, intializing the statistics... +2019-12-18 16:31:23.630 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 10000 trades in 879 ms +2019-12-18 16:31:24.325 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 20000 trades in 695 ms +2019-12-18 16:31:25.111 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 30000 trades in 786 ms +2019-12-18 16:31:25.807 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 40000 trades in 696 ms +2019-12-18 16:31:26.446 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 50000 trades in 639 ms +2019-12-18 16:31:27.089 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 60000 trades in 643 ms +2019-12-18 16:31:27.842 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 70000 trades in 753 ms +2019-12-18 16:31:28.495 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 80000 trades in 653 ms +2019-12-18 16:31:29.127 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 90000 trades in 632 ms +2019-12-18 16:31:29.807 INFO 97971 --- [ main] i.p.test.client.service.TradeService : Destroyed 100000 trades in 680 ms +... +``` +##### Query by Cusip Forever Command +Run the query-by-cusip forever command using the **runclient.sh** script like: + +``` +./runclient.sh querybycusipforever +... +2019-12-18 16:35:55.360 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:36:18.278 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 22918 ms +2019-12-18 16:36:38.614 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 20336 ms +2019-12-18 16:36:58.543 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 19929 ms +2019-12-18 16:37:18.054 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 40000 cusip queries in 19511 ms +2019-12-18 16:37:38.098 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 50000 cusip queries in 20044 ms +2019-12-18 16:37:58.478 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 60000 cusip queries in 20380 ms +2019-12-18 16:38:18.119 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 70000 cusip queries in 19641 ms +2019-12-18 16:38:36.396 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 80000 cusip queries in 18277 ms +2019-12-18 16:38:55.145 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 90000 cusip queries in 18749 ms +2019-12-18 16:39:14.346 INFO 98398 --- [ main] i.p.test.client.service.TradeService : Executed 100000 cusip queries in 19201 ms +... +``` +##### Function Update Forever Command +Run the function update forever command using the **runclient.sh** script like: + +``` +./runclient.sh functionupdateforever 10 +... +2019-12-19 15:39:07.259 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:39:14.541 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 10000 trades with function in 7282 ms +2019-12-19 15:39:18.485 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3944 ms +2019-12-19 15:39:21.483 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 30000 trades with function in 2998 ms +2019-12-19 15:39:24.141 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 40000 trades with function in 2658 ms +2019-12-19 15:39:26.307 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 50000 trades with function in 2166 ms +2019-12-19 15:39:28.426 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 60000 trades with function in 2119 ms +2019-12-19 15:39:30.504 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 70000 trades with function in 2077 ms +2019-12-19 15:39:32.625 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 80000 trades with function in 2121 ms +2019-12-19 15:39:34.810 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 90000 trades with function in 2185 ms +2019-12-19 15:39:36.904 INFO 57950 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 100000 trades with function in 2094 ms +... +``` +##### Multi-threaded Put Forever Command +Run the multi-threaded put forever command using the **runclient.sh** script like: + +``` +./runclient.sh putforever 10 1024 5 +... +2019-12-18 16:46:12.424 INFO 99172 --- [ Thread-6] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:46:12.424 INFO 99172 --- [ Thread-7] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:46:12.424 INFO 99172 --- [ Thread-8] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:46:12.424 INFO 99172 --- [ Thread-9] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:46:12.424 INFO 99172 --- [ Thread-10] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 16:46:22.227 INFO 99172 --- [ Thread-9] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 9802 ms +2019-12-18 16:46:22.255 INFO 99172 --- [ Thread-8] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 9831 ms +2019-12-18 16:46:22.255 INFO 99172 --- [ Thread-7] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 9831 ms +2019-12-18 16:46:22.263 INFO 99172 --- [ Thread-6] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 9839 ms +2019-12-18 16:46:22.277 INFO 99172 --- [ Thread-10] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 9853 ms +2019-12-18 16:46:30.672 INFO 99172 --- [ Thread-10] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8395 ms +2019-12-18 16:46:30.676 INFO 99172 --- [ Thread-9] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8448 ms +2019-12-18 16:46:30.692 INFO 99172 --- [ Thread-7] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8437 ms +2019-12-18 16:46:30.696 INFO 99172 --- [ Thread-8] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8441 ms +2019-12-18 16:46:30.711 INFO 99172 --- [ Thread-6] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8448 ms +2019-12-18 16:46:38.654 INFO 99172 --- [ Thread-10] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 7982 ms +2019-12-18 16:46:38.702 INFO 99172 --- [ Thread-9] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8026 ms +2019-12-18 16:46:38.730 INFO 99172 --- [ Thread-8] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8034 ms +2019-12-18 16:46:38.730 INFO 99172 --- [ Thread-6] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8018 ms +2019-12-18 16:46:38.736 INFO 99172 --- [ Thread-7] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8044 ms +... +``` +##### Multi-threaded Get Forever Command +Run the multi-threaded get forever command using the **runclient.sh** script like: + +``` +./runclient.sh getforever 10 5 +... +2019-12-18 16:49:08.951 INFO 99345 --- [ Thread-6] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:49:08.951 INFO 99345 --- [ Thread-7] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:49:08.951 INFO 99345 --- [ Thread-8] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:49:08.951 INFO 99345 --- [ Thread-9] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:49:08.951 INFO 99345 --- [ Thread-10] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 16:49:10.288 INFO 99345 --- [ Thread-10] i.p.test.client.service.TradeService : Got 10000 trades in 1337 ms +2019-12-18 16:49:10.292 INFO 99345 --- [ Thread-6] i.p.test.client.service.TradeService : Got 10000 trades in 1341 ms +2019-12-18 16:49:10.294 INFO 99345 --- [ Thread-9] i.p.test.client.service.TradeService : Got 10000 trades in 1343 ms +2019-12-18 16:49:10.295 INFO 99345 --- [ Thread-7] i.p.test.client.service.TradeService : Got 10000 trades in 1344 ms +2019-12-18 16:49:10.297 INFO 99345 --- [ Thread-8] i.p.test.client.service.TradeService : Got 10000 trades in 1346 ms +2019-12-18 16:49:11.192 INFO 99345 --- [ Thread-10] i.p.test.client.service.TradeService : Got 20000 trades in 904 ms +2019-12-18 16:49:11.195 INFO 99345 --- [ Thread-6] i.p.test.client.service.TradeService : Got 20000 trades in 901 ms +2019-12-18 16:49:11.200 INFO 99345 --- [ Thread-7] i.p.test.client.service.TradeService : Got 20000 trades in 905 ms +2019-12-18 16:49:11.201 INFO 99345 --- [ Thread-8] i.p.test.client.service.TradeService : Got 20000 trades in 904 ms +2019-12-18 16:49:11.204 INFO 99345 --- [ Thread-9] i.p.test.client.service.TradeService : Got 20000 trades in 910 ms +2019-12-18 16:49:12.059 INFO 99345 --- [ Thread-10] i.p.test.client.service.TradeService : Got 30000 trades in 867 ms +2019-12-18 16:49:12.065 INFO 99345 --- [ Thread-6] i.p.test.client.service.TradeService : Got 30000 trades in 870 ms +2019-12-18 16:49:12.068 INFO 99345 --- [ Thread-8] i.p.test.client.service.TradeService : Got 30000 trades in 867 ms +2019-12-18 16:49:12.070 INFO 99345 --- [ Thread-7] i.p.test.client.service.TradeService : Got 30000 trades in 870 ms +2019-12-18 16:49:12.075 INFO 99345 --- [ Thread-9] i.p.test.client.service.TradeService : Got 30000 trades in 871 ms +... +``` +##### Multi-threaded Destroy Forever Command +Run the multi-threaded destroy forever threads command using the **runclient.sh** script like: + +``` +./runclient.sh destroyforever 10 5 +... +2019-12-18 16:52:34.692 INFO 99731 --- [ Thread-6] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:52:34.692 INFO 99731 --- [ Thread-7] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:52:34.692 INFO 99731 --- [ Thread-8] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:52:34.692 INFO 99731 --- [ Thread-9] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:52:34.693 INFO 99731 --- [ Thread-10] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 16:52:35.831 INFO 99731 --- [ Thread-6] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1139 ms +2019-12-18 16:52:35.835 INFO 99731 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1143 ms +2019-12-18 16:52:35.835 INFO 99731 --- [ Thread-10] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1142 ms +2019-12-18 16:52:35.837 INFO 99731 --- [ Thread-7] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1145 ms +2019-12-18 16:52:35.840 INFO 99731 --- [ Thread-9] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1147 ms +2019-12-18 16:52:36.920 INFO 99731 --- [ Thread-6] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1088 ms +2019-12-18 16:52:36.923 INFO 99731 --- [ Thread-7] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1086 ms +2019-12-18 16:52:36.923 INFO 99731 --- [ Thread-10] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1088 ms +2019-12-18 16:52:36.925 INFO 99731 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1090 ms +2019-12-18 16:52:36.927 INFO 99731 --- [ Thread-9] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1087 ms +2019-12-18 16:52:37.864 INFO 99731 --- [ Thread-6] i.p.test.client.service.TradeService : Destroyed 30000 trades in 944 ms +2019-12-18 16:52:37.867 INFO 99731 --- [ Thread-10] i.p.test.client.service.TradeService : Destroyed 30000 trades in 943 ms +2019-12-18 16:52:37.867 INFO 99731 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 30000 trades in 942 ms +2019-12-18 16:52:37.868 INFO 99731 --- [ Thread-9] i.p.test.client.service.TradeService : Destroyed 30000 trades in 941 ms +2019-12-18 16:52:37.869 INFO 99731 --- [ Thread-7] i.p.test.client.service.TradeService : Destroyed 30000 trades in 946 ms +... +``` +##### Multi-threaded Query by Cusip Forever Command +Run the multi-threaded query-by-cusip forever command using the **runclient.sh** script like: + +``` +./runclient.sh querybycusipforever 5 +... +2019-12-18 16:54:15.296 INFO 99865 --- [ Thread-6] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:54:15.297 INFO 99865 --- [ Thread-8] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:54:15.297 INFO 99865 --- [ Thread-7] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:54:15.297 INFO 99865 --- [ Thread-9] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:54:15.297 INFO 99865 --- [ Thread-10] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 16:55:12.166 INFO 99865 --- [ Thread-6] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 56869 ms +2019-12-18 16:55:12.226 INFO 99865 --- [ Thread-10] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 56929 ms +2019-12-18 16:55:12.426 INFO 99865 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 57129 ms +2019-12-18 16:55:12.654 INFO 99865 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 57357 ms +2019-12-18 16:55:12.763 INFO 99865 --- [ Thread-7] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 57466 ms +2019-12-18 16:56:09.829 INFO 99865 --- [ Thread-6] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 57663 ms +2019-12-18 16:56:09.831 INFO 99865 --- [ Thread-10] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 57605 ms +2019-12-18 16:56:10.236 INFO 99865 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 57810 ms +2019-12-18 16:56:10.355 INFO 99865 --- [ Thread-7] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 57592 ms +2019-12-18 16:56:10.390 INFO 99865 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 57735 ms +2019-12-18 16:57:13.819 INFO 99865 --- [ Thread-10] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 63988 ms +2019-12-18 16:57:14.317 INFO 99865 --- [ Thread-6] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 64487 ms +2019-12-18 16:57:14.716 INFO 99865 --- [ Thread-7] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 64361 ms +2019-12-18 16:57:14.923 INFO 99865 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 64687 ms +2019-12-18 16:57:15.151 INFO 99865 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 64761 ms +... +``` +##### Multi-threaded Function Update Forever Command +Run the multi-threaded function update forever command using the **runclient.sh** script like: + +``` +./runclient.sh functionupdateforever 10 5 +... +2019-12-19 15:46:58.070 INFO 58292 --- [ Thread-7] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:46:58.070 INFO 58292 --- [ Thread-6] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:46:58.070 INFO 58292 --- [ Thread-8] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:46:58.070 INFO 58292 --- [ Thread-9] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:46:58.070 INFO 58292 --- [ Thread-10] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:47:03.126 INFO 58292 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5056 ms +2019-12-19 15:47:03.136 INFO 58292 --- [ Thread-8] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5066 ms +2019-12-19 15:47:03.141 INFO 58292 --- [ Thread-10] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5071 ms +2019-12-19 15:47:03.145 INFO 58292 --- [ Thread-7] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5075 ms +2019-12-19 15:47:03.146 INFO 58292 --- [ Thread-9] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5076 ms +2019-12-19 15:47:06.926 INFO 58292 --- [ Thread-10] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3784 ms +2019-12-19 15:47:06.926 INFO 58292 --- [ Thread-7] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3781 ms +2019-12-19 15:47:06.927 INFO 58292 --- [ Thread-8] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3791 ms +2019-12-19 15:47:06.930 INFO 58292 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3804 ms +2019-12-19 15:47:06.943 INFO 58292 --- [ Thread-9] i.p.test.client.service.TradeService : Updated 20000 trades with function in 3797 ms +2019-12-19 15:47:10.836 INFO 58292 --- [ Thread-10] i.p.test.client.service.TradeService : Updated 30000 trades with function in 3910 ms +2019-12-19 15:47:10.840 INFO 58292 --- [ Thread-7] i.p.test.client.service.TradeService : Updated 30000 trades with function in 3914 ms +2019-12-19 15:47:10.845 INFO 58292 --- [ Thread-8] i.p.test.client.service.TradeService : Updated 30000 trades with function in 3918 ms +2019-12-19 15:47:10.846 INFO 58292 --- [ Thread-6] i.p.test.client.service.TradeService : Updated 30000 trades with function in 3916 ms +2019-12-19 15:47:10.862 INFO 58292 --- [ Thread-9] i.p.test.client.service.TradeService : Updated 30000 trades with function in 3919 ms +... +``` +##### Get One Command +Run the get one command using the **runclient.sh** script like: + +``` +./runclient.sh getone 0 +... +2019-12-18 16:59:25.722 INFO 551 --- [ main] i.p.test.client.service.TradeService : Got Trade(id=0, cusip=GOOGL, shares=27, price=278.51) +``` +##### Query One By Cusip Command +Run the query one by cusip command using the **runclient.sh** script like: + +``` +./runclient.sh queryonebycusip AAPL +... +2019-12-18 17:00:23.615 INFO 636 --- [ main] i.p.test.client.service.TradeService : Executing query for cusip=AAPL +2019-12-18 17:00:23.689 INFO 636 --- [ main] i.p.test.client.service.TradeService : Returned 5 trades for cusip=AAPL in 74 ms: +2019-12-18 17:00:23.689 INFO 636 --- [ main] i.p.test.client.service.TradeService : Trade(id=98, cusip=AAPL, shares=24, price=305.78) +2019-12-18 17:00:23.689 INFO 636 --- [ main] i.p.test.client.service.TradeService : Trade(id=43, cusip=AAPL, shares=0, price=833.94) +2019-12-18 17:00:23.689 INFO 636 --- [ main] i.p.test.client.service.TradeService : Trade(id=68, cusip=AAPL, shares=64, price=383.67) +2019-12-18 17:00:23.689 INFO 636 --- [ main] i.p.test.client.service.TradeService : Trade(id=99, cusip=AAPL, shares=52, price=169.36) +2019-12-18 17:00:23.690 INFO 636 --- [ main] i.p.test.client.service.TradeService : Trade(id=75, cusip=AAPL, shares=45, price=273.66) +``` +##### Test Command +Run the test command using the **runclient.sh** script like: + +``` +./runclient.sh starttest 10 1024 1 +... +2019-12-18 17:02:27.921 INFO 855 --- [ Thread-6] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:02:27.922 INFO 855 --- [ Thread-7] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:02:27.922 INFO 855 --- [ Thread-8] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 17:02:29.679 INFO 855 --- [ Thread-7] i.p.test.client.service.TradeService : Got 10000 trades in 1757 ms +2019-12-18 17:02:31.141 INFO 855 --- [ Thread-7] i.p.test.client.service.TradeService : Got 20000 trades in 1462 ms +2019-12-18 17:02:32.653 INFO 855 --- [ Thread-7] i.p.test.client.service.TradeService : Got 30000 trades in 1512 ms +2019-12-18 17:02:36.009 INFO 855 --- [ Thread-6] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8088 ms +2019-12-18 17:02:43.971 INFO 855 --- [ Thread-6] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 7962 ms +2019-12-18 17:02:50.814 INFO 855 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 22892 ms +2019-12-18 17:02:51.744 INFO 855 --- [ Thread-6] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 7772 ms +2019-12-18 17:03:13.281 INFO 855 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 22467 ms +2019-12-18 17:03:35.607 INFO 855 --- [ Thread-8] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 22325 ms +... +``` +#### REST +##### Start Client Application +Start the client application using the **runclient.sh** script like: + +``` +./runclient.sh wait +2019-12-18 17:06:49.078 INFO 1239 --- [ main] io.pivotal.test.client.Client : Started Client in 2.917 seconds (JVM running for 3.252) +2019-12-18 17:06:49.106 INFO 1239 --- [ main] io.pivotal.test.client.Client : Client Command Line Arguments: [--spring.profiles.active=local, --operation=wait] +2019-12-18 17:06:49.106 INFO 1239 --- [ main] io.pivotal.test.client.Client : Client Option Argument: operation=[wait] +2019-12-18 17:06:49.106 INFO 1239 --- [ main] io.pivotal.test.client.Client : Client Option Argument: spring.profiles.active=[local] +``` +##### Put Command +Run the put command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/put/10/1024 +{"operation":"put","status":"SUCCESS","completionTime":55} +``` +The application will log messages like: + +``` +2019-12-18 17:09:00.073 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Putting 10 trades of size 1024 bytes +2019-12-18 17:09:00.100 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=0, cusip=JNJ, shares=43, price=176.49) +2019-12-18 17:09:00.103 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=1, cusip=MA, shares=40, price=45.30) +2019-12-18 17:09:00.107 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=2, cusip=SBUX, shares=36, price=329.88) +2019-12-18 17:09:00.111 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=3, cusip=UNP, shares=91, price=944.36) +2019-12-18 17:09:00.113 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=4, cusip=MMM, shares=14, price=295.43) +2019-12-18 17:09:00.118 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=5, cusip=NFLX, shares=42, price=808.43) +2019-12-18 17:09:00.121 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=6, cusip=BA, shares=46, price=431.10) +2019-12-18 17:09:00.125 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=7, cusip=AAPL, shares=26, price=163.14) +2019-12-18 17:09:00.127 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=8, cusip=QCOM, shares=14, price=5.41) +2019-12-18 17:09:00.128 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Saved Trade(id=9, cusip=TXN, shares=13, price=149.88) +2019-12-18 17:09:00.128 INFO 1239 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Put 10 trades of size 1024 bytes in 55 ms +``` +###### Get Command +Run the get command using **curl** like: + +``` +curl http://localhost:8080/trades/get/10 +{"operation":"get","status":"SUCCESS","completionTime":41} +``` +The application will log messages like: + +``` +2019-12-18 17:14:33.635 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Getting 10 trades +2019-12-18 17:14:33.648 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=0, cusip=JNJ, shares=43, price=176.49) +2019-12-18 17:14:33.649 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=1, cusip=MA, shares=40, price=45.30) +2019-12-18 17:14:33.671 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=2, cusip=SBUX, shares=36, price=329.88) +2019-12-18 17:14:33.674 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=3, cusip=UNP, shares=91, price=944.36) +2019-12-18 17:14:33.675 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=4, cusip=MMM, shares=14, price=295.43) +2019-12-18 17:14:33.675 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=5, cusip=NFLX, shares=42, price=808.43) +2019-12-18 17:14:33.676 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=6, cusip=BA, shares=46, price=431.10) +2019-12-18 17:14:33.676 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=7, cusip=AAPL, shares=26, price=163.14) +2019-12-18 17:14:33.677 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=8, cusip=QCOM, shares=14, price=5.41) +2019-12-18 17:14:33.677 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got Trade(id=9, cusip=TXN, shares=13, price=149.88) +2019-12-18 17:14:33.677 INFO 1239 --- [nio-8080-exec-4] i.p.test.client.service.TradeService : Got 10 trades in 41 ms +``` +##### Destroy Command +Run the destroy command using **curl** like: + +``` +curl -X DELETE http://localhost:8080/trades/destroy/10 +{"operation":"destroy","status":"SUCCESS","completionTime":35} +``` +The application will log messages like: + +``` +2019-12-18 17:17:34.514 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroying 10 trades +2019-12-18 17:17:34.524 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=0 +2019-12-18 17:17:34.527 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=1 +2019-12-18 17:17:34.532 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=2 +2019-12-18 17:17:34.537 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=3 +2019-12-18 17:17:34.539 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=4 +2019-12-18 17:17:34.541 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=5 +2019-12-18 17:17:34.543 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=6 +2019-12-18 17:17:34.545 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=7 +2019-12-18 17:17:34.547 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=8 +2019-12-18 17:17:34.549 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed key=9 +2019-12-18 17:17:34.549 INFO 1239 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Destroyed 10 trades in 35 ms +``` +##### Query By Cusip Command +Run the query by cusip command using **curl** like: + +``` +curl http://localhost:8080/trades/querybycusip/10 +{"operation":"querybycusip","status":"SUCCESS","completionTime":71} +``` +The application will log messages like: + +``` +2019-12-18 17:18:54.977 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Executing 10 cusip queries +2019-12-18 17:18:55.017 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 1 trades for cusip=JPM +2019-12-18 17:18:55.021 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 0 trades for cusip=KO +2019-12-18 17:18:55.024 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 0 trades for cusip=BUD +2019-12-18 17:18:55.028 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 1 trades for cusip=MRK +2019-12-18 17:18:55.031 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 1 trades for cusip=C +2019-12-18 17:18:55.035 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 3 trades for cusip=LMT +2019-12-18 17:18:55.038 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 0 trades for cusip=KO +2019-12-18 17:18:55.042 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 2 trades for cusip=WMT +2019-12-18 17:18:55.045 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 1 trades for cusip=MCD +2019-12-18 17:18:55.048 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Returned 2 trades for cusip=NVS +2019-12-18 17:18:55.048 INFO 1239 --- [nio-8080-exec-7] i.p.test.client.service.TradeService : Executed 10 cusip queries in 71 ms +``` +##### Function Update Command +Run the function update command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/functionupdate/10 +{"operation":"functionupdate","status":"SUCCESS","completionTime":15} +``` +The application will log messages like: + +``` +2019-12-19 16:14:43.667 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updating 10 trades with function +2019-12-19 16:14:43.670 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 0 result=[true] +2019-12-19 16:14:43.674 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 1 result=[true] +2019-12-19 16:14:43.677 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 2 result=[true] +2019-12-19 16:14:43.678 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 3 result=[true] +2019-12-19 16:14:43.679 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 4 result=[true] +2019-12-19 16:14:43.680 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 5 result=[true] +2019-12-19 16:14:43.680 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 6 result=[true] +2019-12-19 16:14:43.681 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 7 result=[true] +2019-12-19 16:14:43.681 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 8 result=[true] +2019-12-19 16:14:43.682 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated trade 9 result=[true] +2019-12-19 16:14:43.682 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Updated 10 trades with function in 15 ms +``` +##### Put Forever Command +Run the function update command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/putforever/10/1024 +{"operation":"putforeverthreads","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:21:49.050 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:21:56.581 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 7531 ms +2019-12-18 17:22:05.740 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 9159 ms +2019-12-18 17:22:11.330 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 5590 ms +2019-12-18 17:22:16.271 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 40000 trades of size 1024 bytes in 4941 ms +2019-12-18 17:22:21.705 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 50000 trades of size 1024 bytes in 5434 ms +2019-12-18 17:22:27.906 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 60000 trades of size 1024 bytes in 6201 ms +2019-12-18 17:22:33.774 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 70000 trades of size 1024 bytes in 5868 ms +2019-12-18 17:22:39.254 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 80000 trades of size 1024 bytes in 5480 ms +2019-12-18 17:22:44.481 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 90000 trades of size 1024 bytes in 5226 ms +2019-12-18 17:22:49.693 INFO 1239 --- [ Thread-6] i.p.test.client.service.TradeService : Put 100000 trades of size 1024 bytes in 5210 ms +... +``` +##### Get Forever Command +Run the function update command using **curl** like: + +``` +curl http://localhost:8080/trades/getforever/10 +{"operation":"getforeverthreads","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:23:47.516 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:23:48.358 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 10000 trades in 842 ms +2019-12-18 17:23:49.069 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 20000 trades in 711 ms +2019-12-18 17:23:49.789 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 30000 trades in 720 ms +2019-12-18 17:23:50.512 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 40000 trades in 723 ms +2019-12-18 17:23:51.247 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 50000 trades in 735 ms +2019-12-18 17:23:51.971 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 60000 trades in 724 ms +2019-12-18 17:23:52.672 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 70000 trades in 701 ms +2019-12-18 17:23:53.376 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 80000 trades in 704 ms +2019-12-18 17:23:54.067 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 90000 trades in 691 ms +2019-12-18 17:23:54.749 INFO 1239 --- [ Thread-7] i.p.test.client.service.TradeService : Got 100000 trades in 681 ms +... +``` +##### Destroy Forever Command +Run the function update command using **curl** like: + +``` +curl -X DELETE http://localhost:8080/trades/destroyforever/10 +{"operation":"destroyforeverthreads","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:24:45.007 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:24:45.763 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 10000 trades in 756 ms +2019-12-18 17:24:46.471 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 20000 trades in 707 ms +2019-12-18 17:24:47.193 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 30000 trades in 722 ms +2019-12-18 17:24:47.892 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 40000 trades in 699 ms +2019-12-18 17:24:48.585 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 50000 trades in 693 ms +2019-12-18 17:24:49.280 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 60000 trades in 695 ms +2019-12-18 17:24:49.952 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 70000 trades in 672 ms +2019-12-18 17:24:50.604 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 80000 trades in 652 ms +2019-12-18 17:24:51.302 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 90000 trades in 698 ms +2019-12-18 17:24:52.037 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 100000 trades in 735 ms +2019-12-18 17:24:52.709 INFO 1239 --- [ Thread-8] i.p.test.client.service.TradeService : Destroyed 110000 trades in 672 ms +... +``` +##### Query by Cusip Forever Command +Run the function update command using **curl** like: + +``` +curl http://localhost:8080/trades/querybycusipforever +{"operation":"querybycusipforeverthreads","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:25:41.177 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-18 17:26:01.775 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 20598 ms +2019-12-18 17:26:20.484 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 18709 ms +2019-12-18 17:26:39.543 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 19059 ms +2019-12-18 17:26:57.534 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 40000 cusip queries in 17991 ms +2019-12-18 17:27:15.314 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 50000 cusip queries in 17780 ms +2019-12-18 17:27:33.081 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 60000 cusip queries in 17767 ms +2019-12-18 17:27:50.804 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 70000 cusip queries in 17723 ms +2019-12-18 17:28:09.086 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 80000 cusip queries in 18281 ms +2019-12-18 17:28:27.066 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 90000 cusip queries in 17980 ms +2019-12-18 17:28:44.831 INFO 1239 --- [ Thread-9] i.p.test.client.service.TradeService : Executed 100000 cusip queries in 17765 ms +... +``` +##### Function Update Forever Command +Run the function update command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/functionupdateforever/10 +{"operation":"functionupdateforeverthreads","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-19 15:56:31.876 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 15:56:34.579 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2703 ms +2019-12-19 15:56:37.002 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 20000 trades with function in 2423 ms +2019-12-19 15:56:39.491 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 30000 trades with function in 2488 ms +2019-12-19 15:56:41.914 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 40000 trades with function in 2423 ms +2019-12-19 15:56:44.281 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 50000 trades with function in 2366 ms +2019-12-19 15:56:46.519 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 60000 trades with function in 2238 ms +2019-12-19 15:56:48.857 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 70000 trades with function in 2338 ms +2019-12-19 15:56:51.229 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 80000 trades with function in 2372 ms +2019-12-19 15:56:53.563 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 90000 trades with function in 2334 ms +2019-12-19 15:56:56.014 INFO 58371 --- [ Thread-19] i.p.test.client.service.TradeService : Updated 100000 trades with function in 2451 ms +... +``` +##### Multi-threaded Put Forever Command +Run the multi-threaded put forever command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/putforever/10/1024/5 +{"operation":"putforever","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:36:22.188 INFO 3437 --- [ Thread-7] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:36:22.188 INFO 3437 --- [ Thread-8] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:36:22.188 INFO 3437 --- [ Thread-9] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:36:22.188 INFO 3437 --- [ Thread-10] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:36:22.189 INFO 3437 --- [ Thread-11] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-18 17:36:30.755 INFO 3437 --- [ Thread-8] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8567 ms +2019-12-18 17:36:30.780 INFO 3437 --- [ Thread-9] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8592 ms +2019-12-18 17:36:30.788 INFO 3437 --- [ Thread-11] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8599 ms +2019-12-18 17:36:30.792 INFO 3437 --- [ Thread-7] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8604 ms +2019-12-18 17:36:30.793 INFO 3437 --- [ Thread-10] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 8604 ms +2019-12-18 17:36:39.269 INFO 3437 --- [ Thread-11] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8481 ms +2019-12-18 17:36:39.275 INFO 3437 --- [ Thread-9] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8495 ms +2019-12-18 17:36:39.280 INFO 3437 --- [ Thread-10] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8487 ms +2019-12-18 17:36:39.322 INFO 3437 --- [ Thread-7] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8530 ms +2019-12-18 17:36:39.328 INFO 3437 --- [ Thread-8] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 8573 ms +2019-12-18 17:36:48.276 INFO 3437 --- [ Thread-9] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 9001 ms +2019-12-18 17:36:48.296 INFO 3437 --- [ Thread-10] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 9016 ms +2019-12-18 17:36:48.297 INFO 3437 --- [ Thread-7] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8975 ms +2019-12-18 17:36:48.302 INFO 3437 --- [ Thread-8] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 8974 ms +2019-12-18 17:36:48.345 INFO 3437 --- [ Thread-11] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 9076 ms +... +``` +##### Multi-threaded Get Forever Command +Run the multi-threaded get forever command using **curl** like: + +``` +curl http://localhost:8080/trades/getforever/10/5 +{"operation":"getforever","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:41:50.830 INFO 3437 --- [ Thread-12] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:41:50.830 INFO 3437 --- [ Thread-13] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:41:50.830 INFO 3437 --- [ Thread-14] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:41:50.830 INFO 3437 --- [ Thread-15] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:41:50.830 INFO 3437 --- [ Thread-16] i.p.test.client.service.TradeService : Getting entries forever +2019-12-18 17:41:51.745 INFO 3437 --- [ Thread-14] i.p.test.client.service.TradeService : Got 10000 trades in 915 ms +2019-12-18 17:41:51.747 INFO 3437 --- [ Thread-15] i.p.test.client.service.TradeService : Got 10000 trades in 917 ms +2019-12-18 17:41:51.750 INFO 3437 --- [ Thread-12] i.p.test.client.service.TradeService : Got 10000 trades in 920 ms +2019-12-18 17:41:51.750 INFO 3437 --- [ Thread-16] i.p.test.client.service.TradeService : Got 10000 trades in 920 ms +2019-12-18 17:41:51.753 INFO 3437 --- [ Thread-13] i.p.test.client.service.TradeService : Got 10000 trades in 923 ms +2019-12-18 17:41:52.577 INFO 3437 --- [ Thread-14] i.p.test.client.service.TradeService : Got 20000 trades in 831 ms +2019-12-18 17:41:52.581 INFO 3437 --- [ Thread-16] i.p.test.client.service.TradeService : Got 20000 trades in 831 ms +2019-12-18 17:41:52.582 INFO 3437 --- [ Thread-15] i.p.test.client.service.TradeService : Got 20000 trades in 835 ms +2019-12-18 17:41:52.583 INFO 3437 --- [ Thread-12] i.p.test.client.service.TradeService : Got 20000 trades in 833 ms +2019-12-18 17:41:52.590 INFO 3437 --- [ Thread-13] i.p.test.client.service.TradeService : Got 20000 trades in 836 ms +2019-12-18 17:41:53.440 INFO 3437 --- [ Thread-14] i.p.test.client.service.TradeService : Got 30000 trades in 863 ms +2019-12-18 17:41:53.442 INFO 3437 --- [ Thread-16] i.p.test.client.service.TradeService : Got 30000 trades in 861 ms +2019-12-18 17:41:53.444 INFO 3437 --- [ Thread-15] i.p.test.client.service.TradeService : Got 30000 trades in 862 ms +2019-12-18 17:41:53.445 INFO 3437 --- [ Thread-12] i.p.test.client.service.TradeService : Got 30000 trades in 862 ms +2019-12-18 17:41:53.454 INFO 3437 --- [ Thread-13] i.p.test.client.service.TradeService : Got 30000 trades in 864 ms +... +``` +##### Multi-threaded Destroy Forever Command +Run the multi-threaded destroy forever command using **curl** like: + +``` +curl -X DELETE http://localhost:8080/trades/destroyforever/10/5 +{"operation":"destroyforever","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-18 17:45:40.359 INFO 3437 --- [ Thread-17] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:45:40.359 INFO 3437 --- [ Thread-18] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:45:40.359 INFO 3437 --- [ Thread-19] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:45:40.359 INFO 3437 --- [ Thread-20] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:45:40.360 INFO 3437 --- [ Thread-21] i.p.test.client.service.TradeService : Destroying trades forever +2019-12-18 17:45:41.412 INFO 3437 --- [ Thread-17] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1053 ms +2019-12-18 17:45:41.413 INFO 3437 --- [ Thread-21] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1053 ms +2019-12-18 17:45:41.414 INFO 3437 --- [ Thread-20] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1055 ms +2019-12-18 17:45:41.416 INFO 3437 --- [ Thread-19] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1056 ms +2019-12-18 17:45:41.417 INFO 3437 --- [ Thread-18] i.p.test.client.service.TradeService : Destroyed 10000 trades in 1058 ms +2019-12-18 17:45:42.449 INFO 3437 --- [ Thread-17] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1037 ms +2019-12-18 17:45:42.450 INFO 3437 --- [ Thread-21] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1037 ms +2019-12-18 17:45:42.452 INFO 3437 --- [ Thread-20] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1038 ms +2019-12-18 17:45:42.455 INFO 3437 --- [ Thread-19] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1039 ms +2019-12-18 17:45:42.457 INFO 3437 --- [ Thread-18] i.p.test.client.service.TradeService : Destroyed 20000 trades in 1040 ms +2019-12-18 17:45:43.633 INFO 3437 --- [ Thread-17] i.p.test.client.service.TradeService : Destroyed 30000 trades in 1184 ms +2019-12-18 17:45:43.634 INFO 3437 --- [ Thread-21] i.p.test.client.service.TradeService : Destroyed 30000 trades in 1184 ms +2019-12-18 17:45:43.635 INFO 3437 --- [ Thread-20] i.p.test.client.service.TradeService : Destroyed 30000 trades in 1183 ms +2019-12-18 17:45:43.637 INFO 3437 --- [ Thread-19] i.p.test.client.service.TradeService : Destroyed 30000 trades in 1182 ms +2019-12-18 17:45:43.642 INFO 3437 --- [ Thread-18] i.p.test.client.service.TradeService : Destroyed 30000 trades in 1185 ms +... +``` +##### Multi-threaded Query by Cusip Forever Command +Run the multi-threaded query by cusip forever command using **curl** like: + +``` +curl http://localhost:8080/trades/querybycusipforever/5 +{"operation":"querybycusipforever","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-19 16:01:46.684 INFO 58371 --- [ Thread-35] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:01:46.684 INFO 58371 --- [ Thread-36] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:01:46.684 INFO 58371 --- [ Thread-37] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:01:46.685 INFO 58371 --- [ Thread-38] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:01:46.685 INFO 58371 --- [ Thread-39] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:01:56.990 INFO 58371 --- [ Thread-37] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 10306 ms +2019-12-19 16:01:57.003 INFO 58371 --- [ Thread-38] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 10318 ms +2019-12-19 16:01:57.012 INFO 58371 --- [ Thread-35] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 10328 ms +2019-12-19 16:01:57.013 INFO 58371 --- [ Thread-39] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 10328 ms +2019-12-19 16:01:57.013 INFO 58371 --- [ Thread-36] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 10329 ms +2019-12-19 16:02:06.849 INFO 58371 --- [ Thread-37] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 9859 ms +2019-12-19 16:02:06.859 INFO 58371 --- [ Thread-38] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 9856 ms +2019-12-19 16:02:06.879 INFO 58371 --- [ Thread-36] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 9866 ms +2019-12-19 16:02:06.884 INFO 58371 --- [ Thread-39] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 9871 ms +2019-12-19 16:02:06.889 INFO 58371 --- [ Thread-35] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 9877 ms +2019-12-19 16:02:16.623 INFO 58371 --- [ Thread-37] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 9774 ms +2019-12-19 16:02:16.648 INFO 58371 --- [ Thread-38] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 9789 ms +2019-12-19 16:02:16.655 INFO 58371 --- [ Thread-36] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 9775 ms +2019-12-19 16:02:16.666 INFO 58371 --- [ Thread-39] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 9782 ms +2019-12-19 16:02:16.667 INFO 58371 --- [ Thread-35] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 9778 ms +... +``` +##### Multi-threaded Function Update Forever Command +Run the multi-threaded function update command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/functionupdateforever/10/5 +{"operation":"functionupdateforever","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-19 16:03:09.034 INFO 58371 --- [ Thread-41] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 16:03:09.034 INFO 58371 --- [ Thread-42] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 16:03:09.034 INFO 58371 --- [ Thread-40] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 16:03:09.034 INFO 58371 --- [ Thread-43] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 16:03:09.034 INFO 58371 --- [ Thread-44] i.p.test.client.service.TradeService : Updating 10 trades with function forever +2019-12-19 16:03:11.147 INFO 58371 --- [ Thread-43] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2113 ms +2019-12-19 16:03:11.150 INFO 58371 --- [ Thread-44] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2116 ms +2019-12-19 16:03:11.150 INFO 58371 --- [ Thread-42] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2116 ms +2019-12-19 16:03:11.151 INFO 58371 --- [ Thread-40] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2117 ms +2019-12-19 16:03:11.152 INFO 58371 --- [ Thread-41] i.p.test.client.service.TradeService : Updated 10000 trades with function in 2118 ms +2019-12-19 16:03:13.127 INFO 58371 --- [ Thread-42] i.p.test.client.service.TradeService : Updated 20000 trades with function in 1977 ms +2019-12-19 16:03:13.129 INFO 58371 --- [ Thread-43] i.p.test.client.service.TradeService : Updated 20000 trades with function in 1982 ms +2019-12-19 16:03:13.130 INFO 58371 --- [ Thread-41] i.p.test.client.service.TradeService : Updated 20000 trades with function in 1978 ms +2019-12-19 16:03:13.131 INFO 58371 --- [ Thread-44] i.p.test.client.service.TradeService : Updated 20000 trades with function in 1981 ms +2019-12-19 16:03:13.134 INFO 58371 --- [ Thread-40] i.p.test.client.service.TradeService : Updated 20000 trades with function in 1983 ms +2019-12-19 16:03:14.831 INFO 58371 --- [ Thread-44] i.p.test.client.service.TradeService : Updated 30000 trades with function in 1700 ms +2019-12-19 16:03:14.832 INFO 58371 --- [ Thread-42] i.p.test.client.service.TradeService : Updated 30000 trades with function in 1705 ms +2019-12-19 16:03:14.832 INFO 58371 --- [ Thread-41] i.p.test.client.service.TradeService : Updated 30000 trades with function in 1702 ms +2019-12-19 16:03:14.832 INFO 58371 --- [ Thread-43] i.p.test.client.service.TradeService : Updated 30000 trades with function in 1703 ms +2019-12-19 16:03:14.837 INFO 58371 --- [ Thread-40] i.p.test.client.service.TradeService : Updated 30000 trades with function in 1703 ms +... +``` +##### Get One Command +Run the get one command using **curl** like: + +``` +curl http://localhost:8080/trades/getone/0 +{"id":"0","cusip":"NKE","shares":46,"price":343.43,"payload":"..."} +``` +The application will log messages like: + +``` +2019-12-19 16:04:41.261 INFO 58371 --- [nio-8080-exec-5] i.p.test.client.service.TradeService : Got Trade(id=0, cusip=NKE, shares=46, price=343.43) +``` +##### Query One By Cusip Command +Run the query one by cusip command using **curl** like: + +``` +curl http://localhost:8080/trades/queryonebycusip/AAPL +[{"id":"42","cusip":"AAPL","shares":60,"price":720.05,"payload":"..."}] +``` +The application will log messages like: + +``` +2019-12-19 16:07:59.880 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Executing query for cusip=AAPL +2019-12-19 16:07:59.881 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Returned 1 trades for cusip=AAPL in 1 ms: +2019-12-19 16:07:59.881 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Trade(id=42, cusip=AAPL, shares=60, price=720.05) +``` +##### Test Command +Run the test command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/starttest/100/1024/2 +[{"operation":"putforever","status":"SUCCESS","completionTime":0},{"operation":"getforever","status":"SUCCESS","completionTime":0},{"operation":"querybycusipforever","status":"SUCCESS","completionTime":0},{"operation":"functionupdateforever","status":"SUCCESS","completionTime":0}] +``` +The application will log messages like: + +``` +2019-12-19 16:10:19.415 INFO 58371 --- [ Thread-68] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-19 16:10:19.415 INFO 58371 --- [ Thread-69] i.p.test.client.service.TradeService : Putting trades forever of size 1024 bytes +2019-12-19 16:10:19.416 INFO 58371 --- [ Thread-70] i.p.test.client.service.TradeService : Getting entries forever +2019-12-19 16:10:19.416 INFO 58371 --- [ Thread-71] i.p.test.client.service.TradeService : Getting entries forever +2019-12-19 16:10:19.416 INFO 58371 --- [ Thread-72] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:10:19.416 INFO 58371 --- [ Thread-73] i.p.test.client.service.TradeService : Executing cusip queries forever +2019-12-19 16:10:19.417 INFO 58371 --- [ Thread-74] i.p.test.client.service.TradeService : Updating 100 trades with function forever +2019-12-19 16:10:19.417 INFO 58371 --- [ Thread-75] i.p.test.client.service.TradeService : Updating 100 trades with function forever +2019-12-19 16:10:21.578 INFO 58371 --- [ Thread-71] i.p.test.client.service.TradeService : Got 10000 trades in 2162 ms +2019-12-19 16:10:21.583 INFO 58371 --- [ Thread-70] i.p.test.client.service.TradeService : Got 10000 trades in 2167 ms +2019-12-19 16:10:23.766 INFO 58371 --- [ Thread-71] i.p.test.client.service.TradeService : Got 20000 trades in 2188 ms +2019-12-19 16:10:23.778 INFO 58371 --- [ Thread-70] i.p.test.client.service.TradeService : Got 20000 trades in 2195 ms +2019-12-19 16:10:24.341 INFO 58371 --- [ Thread-69] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 4926 ms +2019-12-19 16:10:24.355 INFO 58371 --- [ Thread-68] i.p.test.client.service.TradeService : Put 10000 trades of size 1024 bytes in 4940 ms +2019-12-19 16:10:25.151 INFO 58371 --- [ Thread-74] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5734 ms +2019-12-19 16:10:25.153 INFO 58371 --- [ Thread-75] i.p.test.client.service.TradeService : Updated 10000 trades with function in 5736 ms +2019-12-19 16:10:25.858 INFO 58371 --- [ Thread-71] i.p.test.client.service.TradeService : Got 30000 trades in 2092 ms +2019-12-19 16:10:25.873 INFO 58371 --- [ Thread-70] i.p.test.client.service.TradeService : Got 30000 trades in 2095 ms +2019-12-19 16:10:29.129 INFO 58371 --- [ Thread-69] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 4787 ms +2019-12-19 16:10:29.139 INFO 58371 --- [ Thread-68] i.p.test.client.service.TradeService : Put 20000 trades of size 1024 bytes in 4784 ms +2019-12-19 16:10:30.753 INFO 58371 --- [ Thread-74] i.p.test.client.service.TradeService : Updated 20000 trades with function in 5602 ms +2019-12-19 16:10:30.770 INFO 58371 --- [ Thread-75] i.p.test.client.service.TradeService : Updated 20000 trades with function in 5617 ms +2019-12-19 16:10:32.609 INFO 58371 --- [ Thread-72] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 13193 ms +2019-12-19 16:10:32.621 INFO 58371 --- [ Thread-73] i.p.test.client.service.TradeService : Executed 10000 cusip queries in 13204 ms +2019-12-19 16:10:33.853 INFO 58371 --- [ Thread-69] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 4723 ms +2019-12-19 16:10:33.859 INFO 58371 --- [ Thread-68] i.p.test.client.service.TradeService : Put 30000 trades of size 1024 bytes in 4720 ms +2019-12-19 16:10:36.184 INFO 58371 --- [ Thread-74] i.p.test.client.service.TradeService : Updated 30000 trades with function in 5431 ms +2019-12-19 16:10:36.217 INFO 58371 --- [ Thread-75] i.p.test.client.service.TradeService : Updated 30000 trades with function in 5447 ms +2019-12-19 16:10:45.901 INFO 58371 --- [ Thread-72] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 13292 ms +2019-12-19 16:10:45.911 INFO 58371 --- [ Thread-73] i.p.test.client.service.TradeService : Executed 20000 cusip queries in 13290 ms +2019-12-19 16:10:59.129 INFO 58371 --- [ Thread-72] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 13228 ms +2019-12-19 16:10:59.169 INFO 58371 --- [ Thread-73] i.p.test.client.service.TradeService : Executed 30000 cusip queries in 13258 ms +... +``` +##### Stop Operations Command +Run the stop operations command using **curl** like: + +``` +curl -X POST http://localhost:8080/trades/stopoperations +{"operation":"stopoperations","status":"SUCCESS","completionTime":0} +``` +The application will log messages like: + +``` +2019-12-19 15:51:19.022 INFO 58371 --- [nio-8080-exec-1] i.p.test.client.service.TradeService : Stopping operations +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-8] i.p.test.client.service.TradeService : Stopping after getting 168798 trades +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-9] i.p.test.client.service.TradeService : Stopping after getting 167932 trades +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-10] i.p.test.client.service.TradeService : Stopping after executing 32543 cusip queries +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-11] i.p.test.client.service.TradeService : Stopping after executing 32550 cusip queries +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-12] i.p.test.client.service.TradeService : Stopping after updating 63897 trades with function +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-7] i.p.test.client.service.TradeService : Stopping after putting 74388 trades of size 1024 bytes +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-13] i.p.test.client.service.TradeService : Stopping after updating 63754 trades with function +2019-12-19 15:51:19.022 INFO 58371 --- [ Thread-6] i.p.test.client.service.TradeService : Stopping after putting 74523 trades of size 1024 bytes +``` + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..59d10bf --- /dev/null +++ b/build.gradle @@ -0,0 +1,80 @@ +buildscript { + ext { + springBootVersion = '2.2.2.RELEASE' + } + repositories { + mavenCentral() + maven { url "https://repo.spring.io/snapshot" } + maven { url "https://repo.spring.io/milestone" } + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + } +} + +plugins { + id 'io.franzbecker.gradle-lombok' version '1.11' +} + +allprojects { + repositories { + mavenCentral() + jcenter() + maven { url 'https://repo.spring.io/libs-release' } + maven { url 'https://repo.spring.io/libs-milestone' } + maven { url 'https://repo.spring.io/libs-snapshot' } + } +} + +subprojects { + apply plugin: 'java' + sourceCompatibility = 1.8 + + group = 'example.cloudcache' + version = '0.0.1-SNAPSHOT' + + configurations { + provided + compile.extendsFrom provided + } + + + task copyDependancies(type: Copy) { + into "$buildDir/dependancies" + from(configurations.compile - configurations.provided) + } + + jar { + dependsOn copyDependancies + } +} + +project(':client') { + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' + dependencies { + compile 'org.projectlombok:lombok:1.18.8' + annotationProcessor 'org.projectlombok:lombok:1.18.10' + compile 'org.springframework.geode:spring-geode-starter:1.2.2.RELEASE' + compile 'org.springframework.geode:spring-geode-starter-actuator:1.2.2.RELEASE' + compile "org.springframework.boot:spring-boot-starter-web:2.2.2.RELEASE" + } +} + +project(':client-cq') { + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' + dependencies { + compile 'org.projectlombok:lombok:1.18.8' + annotationProcessor 'org.projectlombok:lombok:1.18.10' + compile 'org.springframework.geode:spring-geode-starter:1.2.2.RELEASE' + compile 'org.springframework.geode:spring-geode-starter-actuator:1.2.2.RELEASE' + compile "org.springframework.boot:spring-boot-starter-web:2.2.2.RELEASE" + } +} + +project(':server') { + dependencies { + provided 'io.pivotal.gemfire:geode-core:9.8.3' + } +} \ No newline at end of file diff --git a/client-cq/manifest.yml b/client-cq/manifest.yml new file mode 100644 index 0000000..e8ed2f9 --- /dev/null +++ b/client-cq/manifest.yml @@ -0,0 +1,10 @@ +--- +applications: + - name: clientCqApp + memory: 768M + instances: 1 + path: build/libs/client_cq-0.0.1-SNAPSHOT.jar + services: + - pccService + buildpacks: + - https://github.com/cloudfoundry/java-buildpack.git \ No newline at end of file diff --git a/client-cq/src/main/java/io/pivotal/test/client/Client.java b/client-cq/src/main/java/io/pivotal/test/client/Client.java new file mode 100644 index 0000000..8bced86 --- /dev/null +++ b/client-cq/src/main/java/io/pivotal/test/client/Client.java @@ -0,0 +1,19 @@ +package io.pivotal.test.client; + +import io.pivotal.test.client.domain.Trade; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions; +import org.springframework.data.gemfire.config.annotation.EnableStatistics; + +@SpringBootApplication +@EnableEntityDefinedRegions(basePackageClasses = Trade.class) +@EnableStatistics +public class Client { + + public static void main(String[] args) { + new SpringApplicationBuilder(Client.class) + .build() + .run(args); + } +} diff --git a/client-cq/src/main/java/io/pivotal/test/client/cq/TradeProcessor.java b/client-cq/src/main/java/io/pivotal/test/client/cq/TradeProcessor.java new file mode 100644 index 0000000..b9d93f6 --- /dev/null +++ b/client-cq/src/main/java/io/pivotal/test/client/cq/TradeProcessor.java @@ -0,0 +1,18 @@ +package io.pivotal.test.client.cq; + +import org.apache.geode.cache.query.CqEvent; +import org.apache.geode.internal.logging.LogService; +import org.apache.logging.log4j.Logger; +import org.springframework.data.gemfire.listener.annotation.ContinuousQuery; +import org.springframework.stereotype.Component; + +@Component +public class TradeProcessor { + + private static final Logger logger = LogService.getLogger(); + + @ContinuousQuery(name = "TradeProcessor", query = "SELECT * FROM /Trades WHERE cusip = 'AAPL'") + public void processTrade(CqEvent event) { + logger.info("TradeProcessor.processTrade processing event=" + event); + } +} diff --git a/client-cq/src/main/java/io/pivotal/test/client/domain/Trade.java b/client-cq/src/main/java/io/pivotal/test/client/domain/Trade.java new file mode 100644 index 0000000..8fc06be --- /dev/null +++ b/client-cq/src/main/java/io/pivotal/test/client/domain/Trade.java @@ -0,0 +1,35 @@ +package io.pivotal.test.client.domain; + +import lombok.Data; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.ToString; +import org.springframework.data.annotation.Id; +import org.springframework.data.gemfire.mapping.annotation.Region; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +@Getter +@ToString(exclude = "payload") +@Region("Trades") +@RequiredArgsConstructor +public class Trade { + + @Id + @NonNull + private final String id; + + @NonNull + private final String cusip; + + private final int shares; + + @NonNull + private final BigDecimal price; + + @NonNull + private final byte[] payload; +} diff --git a/client-cq/src/main/resources/application-local.properties b/client-cq/src/main/resources/application-local.properties new file mode 100644 index 0000000..0383090 --- /dev/null +++ b/client-cq/src/main/resources/application-local.properties @@ -0,0 +1,10 @@ +# GemFire properties +spring.data.gemfire.name=client +spring.data.gemfire.pool.locators=localhost[10334] +spring.data.gemfire.pool.statistic-interval=1000 +spring.data.gemfire.stats.archive-file=client_cq.gfs +spring.data.gemfire.logging.log-file=client_cq.log + +# Spring Actuator Properties +management.endpoint.health.show-details=always +management.endpoints.web.exposure.include=* diff --git a/client-cq/src/main/resources/application.properties b/client-cq/src/main/resources/application.properties new file mode 100644 index 0000000..46b75ae --- /dev/null +++ b/client-cq/src/main/resources/application.properties @@ -0,0 +1,12 @@ +# GemFire properties +# This property was causing this exception in pcfone: +# org.apache.geode.security.GemFireSecurityException: Instance could not be obtained from org.springframework.data.gemfire.config.annotation.support.AutoConfiguredAuthenticationInitializer.newAuthenticationInitializer +#spring.data.gemfire.pool.statistic-interval=1000 + +# Spring Actuator Properties +management.endpoint.health.show-details=always +management.endpoints.web.exposure.include=* + +# GemFire properties +spring.data.gemfire.stats.archive-file=client_cq.gfs +spring.data.gemfire.logging.log-file=client_cq.log diff --git a/client/manifest.yml b/client/manifest.yml new file mode 100644 index 0000000..621415e --- /dev/null +++ b/client/manifest.yml @@ -0,0 +1,10 @@ +--- +applications: + - name: sdgApp + memory: 768M + instances: 1 + path: build/libs/client-0.0.1-SNAPSHOT.jar + services: + - pccService + buildpacks: + - https://github.com/cloudfoundry/java-buildpack.git \ No newline at end of file diff --git a/client/src/main/java/io/pivotal/test/client/Client.java b/client/src/main/java/io/pivotal/test/client/Client.java new file mode 100644 index 0000000..327654d --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/Client.java @@ -0,0 +1,123 @@ +package io.pivotal.test.client; + +import io.pivotal.test.client.domain.Trade; +import io.pivotal.test.client.service.TradeService; +import org.apache.geode.internal.logging.LogService; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions; +import org.springframework.data.gemfire.config.annotation.EnableStatistics; +import org.springframework.geode.boot.autoconfigure.ContinuousQueryAutoConfiguration; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import static io.pivotal.test.client.Constants.*; + +@SpringBootApplication(exclude = ContinuousQueryAutoConfiguration.class) // disable subscriptions +@EnableEntityDefinedRegions(basePackageClasses = Trade.class) +@EnableStatistics +public class Client { + + private static final Logger logger = LogService.getLogger(); + + @Autowired + private TradeService service; + + public static void main(String[] args) { + new SpringApplicationBuilder(Client.class) + .web(WebApplicationType.SERVLET) + .build() + .run(args); + } + + @Bean + ApplicationRunner runner() { + return args -> { + dumpArguments(args); + List operations = args.getOptionValues(OPERATION); + if (operations == null || operations.get(0).equals("wait")) { + waitForever(); + } else { + String operation = operations.get(0); + String parameter1 = (args.containsOption(PARAMETER_1)) ? args.getOptionValues(PARAMETER_1).get(0) : null; + String parameter2 = (args.containsOption(PARAMETER_2)) ? args.getOptionValues(PARAMETER_2).get(0) : null; + String parameter3 = (args.containsOption(PARAMETER_3)) ? args.getOptionValues(PARAMETER_3).get(0) : null; + switch (operation) { + case PUT: + this.service.put(Integer.parseInt(parameter1), Integer.parseInt(parameter2)); + break; + case GET: + this.service.get(Integer.parseInt(parameter1)); + break; + case DESTROY: + this.service.destroy(Integer.parseInt(parameter1)); + break; + case QUERY_BY_CUSIP: + this.service.queryByCusip(Integer.parseInt(parameter1)); + break; + case FUNCTION_UPDATE: + this.service.functionUpdate(Integer.parseInt(parameter1)); + break; + case PUT_FOREVER: + Optional putThreads = parameter3 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter3)); + this.service.putForever(Integer.parseInt(parameter1), Integer.parseInt(parameter2), putThreads); + break; + case GET_FOREVER: + Optional getThreads = parameter2 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter2)); + this.service.getForever(Integer.parseInt(parameter1), getThreads); + break; + case DESTROY_FOREVER: + Optional destroyThreads = parameter2 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter2)); + this.service.destroyForever(Integer.parseInt(parameter1), destroyThreads); + break; + case QUERY_BY_CUSIP_FOREVER: + Optional queryThreads = parameter1 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter1)); + this.service.queryByCusipForever(queryThreads); + break; + case FUNCTION_UPDATE_FOREVER: + Optional functionThreads = parameter2 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter2)); + this.service.functionUpdateForever(Integer.parseInt(parameter1), functionThreads); + break; + case GET_ONE: + this.service.getOne(Integer.parseInt(parameter1)); + break; + case QUERY_ONE_BY_CUSIP: + this.service.queryOneByCusip(parameter1); + break; + case START_TEST: + Optional testThreads = parameter3 == null ? Optional.empty() : Optional.of(Integer.parseInt(parameter3)); + this.service.startTest(Integer.parseInt(parameter1), Integer.parseInt(parameter2), testThreads); + break; + } + } + }; + } + +// @Bean +// MappingPdxSerializer myCustomMappingPdxSerializer() { +// logger.warn("XXX Client.myCustomMappingPdxSerializer ", new Exception()); +// return MappingPdxSerializer.newMappingPdxSerializer(); +// } + + private void dumpArguments(ApplicationArguments args) { + logger.info("Client Command Line Arguments: " + Arrays.toString(args.getSourceArgs())); + for (String name : args.getOptionNames()){ + logger.info("Client Option Argument: " + name + "=" + args.getOptionValues(name)); + } + } + + private void waitForever() throws InterruptedException { + Object obj = new Object(); + synchronized (obj) { + obj.wait(); + } + } +} diff --git a/client/src/main/java/io/pivotal/test/client/Constants.java b/client/src/main/java/io/pivotal/test/client/Constants.java new file mode 100644 index 0000000..4eb0267 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/Constants.java @@ -0,0 +1,58 @@ +package io.pivotal.test.client; + +public interface Constants { + + String OPERATION = "operation"; + + String PARAMETER_1 = "parameter1"; + + String PARAMETER_2 = "parameter2"; + + String PARAMETER_3 = "parameter3"; + + String PUT = "put"; + + String GET = "get"; + + String DESTROY = "destroy"; + + String QUERY_BY_CUSIP = "querybycusip"; + + String FUNCTION_UPDATE = "functionupdate"; + + String PUT_FOREVER = "putforever"; + + String GET_FOREVER = "getforever"; + + String DESTROY_FOREVER = "destroyforever"; + + String QUERY_BY_CUSIP_FOREVER = "querybycusipforever"; + + String FUNCTION_UPDATE_FOREVER = "functionupdateforever"; + + String GET_ONE = "getone"; + + String QUERY_ONE_BY_CUSIP = "queryonebycusip"; + + String START_TEST = "starttest"; + + String STOP_OPERATIONS = "stopoperations"; + + String TRADES_PATH = "/trades/"; + + String KEY_PARAMETER = "/{key}"; + + String CUSIP_PARAMETER = "/{cusip}"; + + String ENTRIES_PARAMETER = "/{entries}"; + + String SIZE_PARAMETER = "/{size}"; + + String QUERIES_PARAMETER = "/{queries}"; + + String THREADS_PARAMETER = "/{threads}"; + + String METRICS_PATH = "/metrics"; + + String METRICS_TYPE_PARAMETER = "/{type}"; +} diff --git a/client/src/main/java/io/pivotal/test/client/controller/AdminController.java b/client/src/main/java/io/pivotal/test/client/controller/AdminController.java new file mode 100644 index 0000000..6ebf474 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/controller/AdminController.java @@ -0,0 +1,57 @@ +package io.pivotal.test.client.controller; + +import io.pivotal.test.client.function.AdminFunctions; +import org.apache.geode.cache.client.Pool; +import org.apache.geode.cache.client.PoolManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Collection; +import java.util.Map; + +@RestController +public class AdminController { + +// @Autowired +// private AdminFunctions functions; + + @GetMapping("/pools") + @ResponseStatus(HttpStatus.OK) + public String getPools() { + StringBuilder builder = new StringBuilder(); + Collection pools = PoolManager.getAll().values(); + builder + .append("The client defines the following ") + .append(pools.size()) + .append(" pools:"); + for (Pool pool : pools) { + builder + .append("\n\tname=") + .append(pool.getName()) + .append("; locators=") + .append(pool.getLocators()); + } + return builder.toString(); + } + +// @GetMapping("/metrics/{type}") +// @ResponseStatus(HttpStatus.OK) +// public Object getMetrics(@PathVariable String type) { +// StringBuilder builder = new StringBuilder(); +// Map>> allServerMetrics = this.functions.getMetrics(type); +// for (Map.Entry>> serverMetrics : allServerMetrics.entrySet()) { +// builder.append("\n").append(serverMetrics.getKey()).append(":"); +// for (Map.Entry> serverMetricTypes : serverMetrics.getValue().entrySet()) { +// builder.append("\n\t").append(serverMetricTypes.getKey()).append(":"); +// for (Map.Entry serverMetric : serverMetricTypes.getValue().entrySet()) { +// builder.append("\n\t\t").append(serverMetric.getKey()).append("=").append(serverMetric.getValue()); +// } +// } +// } +// return builder.toString(); +// } +} diff --git a/client/src/main/java/io/pivotal/test/client/controller/TradeController.java b/client/src/main/java/io/pivotal/test/client/controller/TradeController.java new file mode 100644 index 0000000..0d3273c --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/controller/TradeController.java @@ -0,0 +1,137 @@ +package io.pivotal.test.client.controller; + +import io.pivotal.test.client.domain.Trade; +import io.pivotal.test.client.service.OperationResponse; +import io.pivotal.test.client.service.TradeService; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Collection; +import java.util.Optional; + +import static io.pivotal.test.client.Constants.*; + +@RestController +public class TradeController { + + private final TradeService service; + + public TradeController(TradeService service) { + this.service = service; + } + + @GetMapping("/") + @ResponseStatus(HttpStatus.OK) + public String index() { + return "Spring Data Geode Example"; + } + + @GetMapping(TRADES_PATH + QUERY_ONE_BY_CUSIP + CUSIP_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public Collection queryOneByCusip(@PathVariable String cusip) { + return this.service.queryOneByCusip( + cusip); + } + + @GetMapping(TRADES_PATH + GET_ONE + KEY_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public Trade getOne(@PathVariable int key) { + return this.service.getOne(key); + } + + @GetMapping(TRADES_PATH + GET + ENTRIES_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public OperationResponse get(@PathVariable int entries) { + return this.service.get(entries); + } + + @PostMapping(TRADES_PATH + PUT + ENTRIES_PARAMETER + SIZE_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public OperationResponse put(@PathVariable int entries, @PathVariable int size) { + return this.service.put(entries, size); + } + + @DeleteMapping(TRADES_PATH + DESTROY + ENTRIES_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public OperationResponse destroy(@PathVariable int entries) { + return this.service.destroy(entries); + } + + @GetMapping(TRADES_PATH + QUERY_BY_CUSIP + QUERIES_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public OperationResponse queryByCusip(@PathVariable int queries) { + return this.service.queryByCusip(queries); + } + + @PostMapping(TRADES_PATH + FUNCTION_UPDATE + ENTRIES_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public OperationResponse functionUpdate(@PathVariable int entries) { + return this.service.functionUpdate(entries); + } + + @PostMapping(value = { + TRADES_PATH + PUT_FOREVER + ENTRIES_PARAMETER + SIZE_PARAMETER, + TRADES_PATH + PUT_FOREVER + ENTRIES_PARAMETER + SIZE_PARAMETER + THREADS_PARAMETER }) + @ResponseStatus(HttpStatus.OK) + public OperationResponse putForever(@PathVariable int entries, @PathVariable int size, @PathVariable Optional threads) { + return this.service.putForever(entries, size, threads); + } + + @GetMapping(value = { + TRADES_PATH + GET_FOREVER + ENTRIES_PARAMETER, + TRADES_PATH + GET_FOREVER + ENTRIES_PARAMETER + THREADS_PARAMETER }) + @ResponseStatus(HttpStatus.OK) + public OperationResponse getForever(@PathVariable int entries, @PathVariable Optional threads) { + return this.service.getForever(entries, threads); + } + + @DeleteMapping(value = { + TRADES_PATH + DESTROY_FOREVER + ENTRIES_PARAMETER, + TRADES_PATH + DESTROY_FOREVER + ENTRIES_PARAMETER + THREADS_PARAMETER }) + @ResponseStatus(HttpStatus.OK) + public OperationResponse destroyForever(@PathVariable int entries, @PathVariable Optional threads) { + return this.service.destroyForever(entries, threads); + } + + @GetMapping(value = { + TRADES_PATH + QUERY_BY_CUSIP_FOREVER, + TRADES_PATH + QUERY_BY_CUSIP_FOREVER + THREADS_PARAMETER}) + @ResponseStatus(HttpStatus.OK) + public OperationResponse queryByCusipForever(@PathVariable Optional threads) { + return this.service.queryByCusipForever(threads); + } + + @PostMapping(value = { + TRADES_PATH + FUNCTION_UPDATE_FOREVER + ENTRIES_PARAMETER, + TRADES_PATH + FUNCTION_UPDATE_FOREVER + ENTRIES_PARAMETER + THREADS_PARAMETER}) + @ResponseStatus(HttpStatus.OK) + public OperationResponse functionUpdateForever(@PathVariable int entries, @PathVariable Optional threads) { + return this.service.functionUpdateForever(entries, threads); + } + + @PostMapping(value = { + TRADES_PATH + START_TEST + ENTRIES_PARAMETER + SIZE_PARAMETER, + TRADES_PATH + START_TEST + ENTRIES_PARAMETER + SIZE_PARAMETER + THREADS_PARAMETER + }) + @ResponseStatus(HttpStatus.OK) + public OperationResponse[] startTest(@PathVariable int entries, @PathVariable int size, @PathVariable Optional threads) { + return this.service.startTest(entries, size, threads); + } + + @PostMapping(TRADES_PATH + STOP_OPERATIONS) + @ResponseStatus(HttpStatus.OK) + public OperationResponse stopOperations() { + return this.service.stopOperations(); + } + + @GetMapping(METRICS_PATH + METRICS_TYPE_PARAMETER) + @ResponseStatus(HttpStatus.OK) + public Object getMetrics(@PathVariable String type) { + return this.service.getMetrics(type); + } +} diff --git a/client/src/main/java/io/pivotal/test/client/domain/CusipHelper.java b/client/src/main/java/io/pivotal/test/client/domain/CusipHelper.java new file mode 100755 index 0000000..515c32a --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/domain/CusipHelper.java @@ -0,0 +1,21 @@ +package io.pivotal.test.client.domain; + +import java.util.Random; + +public class CusipHelper { + + private static final Random RANDOM = new Random(); + + private static final String[] CUSIPS = new String[] { + "AAPL", "MSFT", "AMZN", "GOOGL", "FB", "JPM", "V", "JNJ", "WMT", "PG", + "BAC", "XOM", "MA", "UNH", "VZ", "INTC", "HD", "KO", "MRK", "WFC", "PFE", + "NVS", "TM", "CMCSA", "BA", "PEP", "CSCO", "ORCL", "C", "SAP", "HSBC", + "ADBE", "MCD", "NKE", "NFLX", "COST", "BUD", "HON", "PYPL", "AVGO", "CRM", + "UNP", "IBM", "LLY", "TXN", "LMT", "SBUX", "UPS", "QCOM", "CVS", "AXP", + "MMM", "BMY", "GE" + }; + + public static String getCusip() { + return CUSIPS[RANDOM.nextInt(CUSIPS.length)]; + } +} diff --git a/client/src/main/java/io/pivotal/test/client/domain/Trade.java b/client/src/main/java/io/pivotal/test/client/domain/Trade.java new file mode 100644 index 0000000..79ebafb --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/domain/Trade.java @@ -0,0 +1,34 @@ +package io.pivotal.test.client.domain; + +import lombok.Data; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.ToString; +import org.springframework.data.annotation.Id; +import org.springframework.data.gemfire.mapping.annotation.Region; + +import java.math.BigDecimal; + +@Data +@Getter +@ToString(exclude = "payload") +@Region("Trades") +@RequiredArgsConstructor +public class Trade { + + @Id + @NonNull + private final String id; + + @NonNull + private final String cusip; + + private final int shares; + + @NonNull + private final BigDecimal price; + + @NonNull + private final byte[] payload; +} diff --git a/client/src/main/java/io/pivotal/test/client/function/AdminFunctions.java b/client/src/main/java/io/pivotal/test/client/function/AdminFunctions.java new file mode 100644 index 0000000..91dc8b2 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/function/AdminFunctions.java @@ -0,0 +1,16 @@ +package io.pivotal.test.client.function; + +import org.springframework.data.gemfire.function.annotation.FunctionId; +import org.springframework.data.gemfire.function.annotation.OnRegion; +//import org.springframework.data.gemfire.function.annotation.OnServers; + +import java.util.Map; + +//@OnServers(resultCollector = "adminResultCollector") +@OnRegion(region = "Trades", resultCollector = "adminResultCollector") +public interface AdminFunctions { + + @FunctionId("GetMetricsFunction") + //Map>> getMetrics(String type); + Object getMetrics(); +} diff --git a/client/src/main/java/io/pivotal/test/client/function/AdminFunctionsResultCollector.java b/client/src/main/java/io/pivotal/test/client/function/AdminFunctionsResultCollector.java new file mode 100644 index 0000000..dbedd2f --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/function/AdminFunctionsResultCollector.java @@ -0,0 +1,68 @@ +package io.pivotal.test.client.function; + +import org.apache.geode.cache.execute.FunctionException; +import org.apache.geode.cache.execute.ResultCollector; +import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.internal.logging.LogService; +import org.springframework.stereotype.Component; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; + +@Component("adminResultCollector") +public class AdminFunctionsResultCollector implements ResultCollector { + + private Map results = new ConcurrentHashMap<>(); + + @Override + public Set getResult() throws FunctionException { + // SDG OnServers functions expect an iterable containing one element (the actual result). + // In this case the first element of the iterable is passed to the caller. + // java.lang.ClassCastException: java.util.concurrent.ConcurrentHashMap cannot be cast to java.lang.Iterable + // at org.springframework.data.gemfire.function.execution.AbstractFunctionExecution.execute(AbstractFunctionExecution.java:140) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionExecution.execute(AbstractFunctionExecution.java:95) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionExecution.executeAndExtract(AbstractFunctionExecution.java:158) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate.executeAndExtract(AbstractFunctionTemplate.java:79) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate.executeAndExtract(AbstractFunctionTemplate.java:57) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.GemfireOnServersFunctionTemplate.executeAndExtract(GemfireOnServersFunctionTemplate.java:45) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.GemfireFunctionProxyFactoryBean.invokeFunction(GemfireFunctionProxyFactoryBean.java:102) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + // at org.springframework.data.gemfire.function.execution.GemfireFunctionProxyFactoryBean.invoke(GemfireFunctionProxyFactoryBean.java:96) ~[spring-data-geode-2.2.1.RELEASE.jar:2.2.1.RELEASE] + + // SDG OnRegions functions expect an iterable result. In this case, the iterable is passed to the caller. + // java.lang.ClassCastException: java.util.concurrent.ConcurrentHashMap cannot be cast to java.lang.Iterable + // at org.springframework.data.gemfire.function.execution.AbstractFunctionExecution.execute(AbstractFunctionExecution.java:140) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionExecution.execute(AbstractFunctionExecution.java:95) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate.execute(AbstractFunctionTemplate.java:71) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate.execute(AbstractFunctionTemplate.java:52) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.GemfireOnRegionFunctionTemplate.execute(GemfireOnRegionFunctionTemplate.java:26) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.OnRegionFunctionProxyFactoryBean.invokeFunction(OnRegionFunctionProxyFactoryBean.java:65) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.OnRegionFunctionProxyFactoryBean.invokeFunction(OnRegionFunctionProxyFactoryBean.java:28) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + // at org.springframework.data.gemfire.function.execution.GemfireFunctionProxyFactoryBean.invoke(GemfireFunctionProxyFactoryBean.java:96) ~[spring-data-geode-2.2.3.RELEASE.jar:2.2.3.RELEASE] + + return Collections.singleton(this.results); + } + + @Override + public Set getResult(long timeout, TimeUnit unit) throws FunctionException, InterruptedException { + return getResult(); + } + + @Override + public void addResult(DistributedMember memberID, Map result) { + //LogService.getLogger().warn("XXX AdminFunctionsResultCollector.addResult memberID=" + memberID + "; result=" + result); + this.results.put(memberID.toString(), result); + } + + @Override + public void endResults() { + + } + + @Override + public void clearResults() { + this.results.clear(); + } +} diff --git a/client/src/main/java/io/pivotal/test/client/function/TradeFunctions.java b/client/src/main/java/io/pivotal/test/client/function/TradeFunctions.java new file mode 100644 index 0000000..573a73b --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/function/TradeFunctions.java @@ -0,0 +1,15 @@ +package io.pivotal.test.client.function; + +import org.springframework.data.gemfire.function.annotation.Filter; +import org.springframework.data.gemfire.function.annotation.FunctionId; +import org.springframework.data.gemfire.function.annotation.OnRegion; + +import java.math.BigDecimal; +import java.util.Set; + +@OnRegion(region = "Trades") +public interface TradeFunctions { + + @FunctionId("UpdateTradeFunction") + Object updateTrade(@Filter Set keys, int shares, BigDecimal price); +} \ No newline at end of file diff --git a/client/src/main/java/io/pivotal/test/client/metrics/Metrics.java b/client/src/main/java/io/pivotal/test/client/metrics/Metrics.java new file mode 100644 index 0000000..5b7db84 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/metrics/Metrics.java @@ -0,0 +1,20 @@ +package io.pivotal.test.client.metrics; + +import lombok.Getter; +import lombok.ToString; + +import java.util.Map; + +@Getter +@ToString +public class Metrics { + + private Map clientMetrics; + + private Map serverMetrics; + + public Metrics(Map clientMetrics, Map serverMetrics) { + this.clientMetrics = clientMetrics; + this.serverMetrics = serverMetrics; + } +} diff --git a/client/src/main/java/io/pivotal/test/client/metrics/MetricsHelper.java b/client/src/main/java/io/pivotal/test/client/metrics/MetricsHelper.java new file mode 100644 index 0000000..7b14ddf --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/metrics/MetricsHelper.java @@ -0,0 +1,68 @@ +package io.pivotal.test.client.metrics; + +import org.apache.geode.StatisticDescriptor; +import org.apache.geode.Statistics; +import org.apache.geode.StatisticsType; +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.internal.statistics.platform.LinuxSystemStats; +import org.apache.geode.management.ManagementService; +import org.apache.geode.management.OSMetrics; +import org.apache.geode.management.internal.beans.MemberMBean; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +public class MetricsHelper { + + public static void addOSMetrics(Map allMetrics) { + InternalDistributedSystem system = (InternalDistributedSystem) CacheFactory.getAnyInstance().getDistributedSystem(); + + Map osMetrics = new TreeMap(); + allMetrics.put("os", osMetrics); + + // If the linux system statistics exist, add them to the os metrics map. + // Otherwise add the available stats from the osmetrics. + Statistics[] systemStatisticsArr = system.findStatisticsByType(LinuxSystemStats.getType()); + if (systemStatisticsArr.length > 0) { + Statistics systemStatistics = systemStatisticsArr[0]; + StatisticsType type = systemStatistics.getType(); + for (StatisticDescriptor descriptor : type.getStatistics()) { + String statName = descriptor.getName(); + Number statValue = systemStatistics.get(statName); + osMetrics.put(statName, statValue); + } + } + } + + public static void addGCMetrics(Map allMetrics) { + Map gcMetrics = new TreeMap(); + allMetrics.put("gc", gcMetrics); + List gcBeans = ManagementFactory.getGarbageCollectorMXBeans(); + for (GarbageCollectorMXBean gcBean : gcBeans) { + gcMetrics.put(gcBean.getName() + "_collections", gcBean.getCollectionCount()); + gcMetrics.put(gcBean.getName() + "_collectionTime", gcBean.getCollectionTime()); + } + } + + public static void addMemoryMetrics(Map allMetrics) { + Map memoryMetrics = new TreeMap(); + allMetrics.put("memory", memoryMetrics); + List memoryBeans = ManagementFactory.getMemoryPoolMXBeans(); + for (MemoryPoolMXBean memoryBean : memoryBeans) { + if (memoryBean.getName().contains("Old") || memoryBean.getName().contains("Eden")) { + String memoryBeanName = memoryBean.getName().replaceAll(" ", "_"); + MemoryUsage usage = memoryBean.getUsage(); + memoryMetrics.put(memoryBeanName + "_init", usage.getInit()); + memoryMetrics.put(memoryBeanName + "_used", usage.getUsed()); + memoryMetrics.put(memoryBeanName + "_max", usage.getMax()); + } + } + } +} diff --git a/client/src/main/java/io/pivotal/test/client/repository/TradeRepository.java b/client/src/main/java/io/pivotal/test/client/repository/TradeRepository.java new file mode 100644 index 0000000..01c51aa --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/repository/TradeRepository.java @@ -0,0 +1,11 @@ +package io.pivotal.test.client.repository; + +import io.pivotal.test.client.domain.Trade; +import org.springframework.data.gemfire.repository.GemfireRepository; + +import java.util.Collection; + +public interface TradeRepository extends GemfireRepository { + + Collection findByCusip(String cusip); +} diff --git a/client/src/main/java/io/pivotal/test/client/service/OperationResponse.java b/client/src/main/java/io/pivotal/test/client/service/OperationResponse.java new file mode 100644 index 0000000..a33cfe5 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/service/OperationResponse.java @@ -0,0 +1,19 @@ +package io.pivotal.test.client.service; + +import lombok.Getter; + +@Getter +public class OperationResponse { + + private String operation; + + private Status status; + + private long completionTime; + + public OperationResponse(String operation, Status status, long completionTime) { + this.operation = operation; + this.status = status; + this.completionTime = completionTime; + } +} diff --git a/client/src/main/java/io/pivotal/test/client/service/Status.java b/client/src/main/java/io/pivotal/test/client/service/Status.java new file mode 100644 index 0000000..a89eb85 --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/service/Status.java @@ -0,0 +1,6 @@ +package io.pivotal.test.client.service; + +public enum Status { + SUCCESS, + FAILURE +} diff --git a/client/src/main/java/io/pivotal/test/client/service/TradeService.java b/client/src/main/java/io/pivotal/test/client/service/TradeService.java new file mode 100644 index 0000000..37573ef --- /dev/null +++ b/client/src/main/java/io/pivotal/test/client/service/TradeService.java @@ -0,0 +1,366 @@ +package io.pivotal.test.client.service; + +import io.pivotal.test.client.domain.CusipHelper; +import io.pivotal.test.client.domain.Trade; +import io.pivotal.test.client.function.AdminFunctions; +import io.pivotal.test.client.function.TradeFunctions; +import io.pivotal.test.client.metrics.Metrics; +import io.pivotal.test.client.metrics.MetricsHelper; +import io.pivotal.test.client.repository.TradeRepository; +import org.apache.geode.internal.logging.LogService; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; +import java.util.Random; +import java.util.TreeMap; +import java.util.concurrent.atomic.AtomicInteger; + +import static io.pivotal.test.client.Constants.*; + +@Service +public class TradeService { + + @Autowired + private TradeRepository repository; + + @Autowired + private TradeFunctions tradeFunctions; + + @Autowired + private AdminFunctions adminFunctions; + + private final AtomicInteger putOperations = new AtomicInteger(); + + private final AtomicInteger getOperations = new AtomicInteger(); + + private final AtomicInteger destroyOperations = new AtomicInteger(); + + private final AtomicInteger queryByCusipOperations = new AtomicInteger(); + + private final AtomicInteger functionUpdateOperations = new AtomicInteger(); + + private volatile boolean continueOperations; + + private static final Logger logger = LogService.getLogger(); + + private static final Random RANDOM = new Random(); + + private static final int ENTRIES_TO_LOG = 10000; + + public Collection queryOneByCusip(String cusip) { + logger.info("Executing query for cusip=" + cusip); + long start, end; + start = System.currentTimeMillis(); + Collection results = executeFindByCusipQuery(cusip); + end = System.currentTimeMillis(); + logger.info("Returned " + results.size() + " trades for cusip=" + cusip + " in " + (end-start) + " ms:"); + for (Trade trade : results) { + logger.info("\t" + trade); + } + return results; + } + + public Trade getOne(int key) { + return get(key, true); + } + + public OperationResponse put(int numEntries, int entrySize) { + logger.info("Putting " + numEntries + " trades of size " + entrySize + " bytes"); + long start, end; + start = System.currentTimeMillis(); + for (int i=0; i results = executeFindByCusipQuery(cusip); + logger.info("Returned " + results.size() + " trades for cusip=" + cusip); + } + end = System.currentTimeMillis(); + logger.info("Executed " + numQueries + " cusip queries in " + (end-start) + " ms"); + return new OperationResponse(QUERY_BY_CUSIP, Status.SUCCESS, end-start); + } + + public OperationResponse functionUpdate(int numEntries) { + logger.info("Updating " + numEntries + " trades with function"); + long start, end; + start = System.currentTimeMillis(); + for (int i = 0; i < numEntries; i++) { + Object result = executUpdateFunction(i); + logger.info("Updated trade " + i + " result=" + result); + } + end = System.currentTimeMillis(); + logger.info("Updated " + numEntries + " trades with function in " + (end - start) + " ms"); + return new OperationResponse(FUNCTION_UPDATE, Status.SUCCESS, end - start); + } + + public void putForever(int numEntries, int entrySize) { + logger.info("Putting " + numEntries + " trades of size " + entrySize + " bytes forever"); + this.continueOperations = true; + this.putOperations.set(0); + int i=0; + long start=0, end=0; + start = System.currentTimeMillis(); + while (continueOperations()) { + put(RANDOM.nextInt(numEntries), entrySize, false); + if ((i+1) % ENTRIES_TO_LOG == 0) { + end = System.currentTimeMillis(); + logger.info("Put " + (i+1) + " trades of size " + entrySize + " bytes in " + (end-start) + " ms"); + start = System.currentTimeMillis(); + } + i++; + this.putOperations.incrementAndGet(); + } + logger.info("Stopping after putting " + i + " trades of size " + entrySize + " bytes"); + } + + public void getForever(int numEntries) { + logger.info("Getting " + numEntries + " trades forever"); + this.continueOperations = true; + this.getOperations.set(0); + int i=0; + long start=0, end=0; + start = System.currentTimeMillis(); + while (continueOperations()) { + get(RANDOM.nextInt(numEntries), false); + if ((i+1) % ENTRIES_TO_LOG == 0) { + end = System.currentTimeMillis(); + logger.info("Got " + (i+1) + " trades in " + (end-start) + " ms"); + start = System.currentTimeMillis(); + } + i++; + this.getOperations.incrementAndGet(); + } + logger.info("Stopping after getting " + i + " trades"); + } + + public void destroyForever(int numEntries) { + logger.info("Destroying " + numEntries + " trades forever"); + this.continueOperations = true; + this.destroyOperations.set(0); + int i=0; + long start=0, end=0; + start = System.currentTimeMillis(); + while (continueOperations()) { + destroy(RANDOM.nextInt(numEntries), false); + if ((i+1) % ENTRIES_TO_LOG == 0) { + end = System.currentTimeMillis(); + logger.info("Destroyed " + (i+1) + " trades in " + (end-start) + " ms"); + start = System.currentTimeMillis(); + } + i++; + this.destroyOperations.incrementAndGet(); + } + logger.info("Stopping after destroying " + i + " trades"); + } + + public void queryByCusipForever() { + logger.info("Executing cusip queries forever"); + this.continueOperations = true; + this.queryByCusipOperations.set(0); + int i=0; + long start=0, end=0; + start = System.currentTimeMillis(); + while (continueOperations()) { + executeFindByCusipQuery(CusipHelper.getCusip()); + if ((i+1) % ENTRIES_TO_LOG == 0) { + end = System.currentTimeMillis(); + logger.info("Executed " + (i+1) + " cusip queries in " + (end-start) + " ms"); + start = System.currentTimeMillis(); + } + i++; + this.queryByCusipOperations.incrementAndGet(); + } + logger.info("Stopping after executing " + i + " cusip queries"); + } + + public void functionUpdateForever(int numEntries) { + logger.info("Updating " + numEntries + " trades with function forever"); + this.continueOperations = true; + this.functionUpdateOperations.set(0); + int i=0; + long start=0, end=0; + start = System.currentTimeMillis(); + while (continueOperations()) { + executUpdateFunction(RANDOM.nextInt(numEntries)); + if ((i+1) % ENTRIES_TO_LOG == 0) { + end = System.currentTimeMillis(); + logger.info("Updated " + (i+1) + " trades with function in " + (end-start) + " ms"); + start = System.currentTimeMillis(); + } + i++; + this.functionUpdateOperations.incrementAndGet(); + } + logger.info("Stopping after updating " + i + " trades with function"); + } + + public OperationResponse putForever(final int numEntries, final int entrySize, Optional numThreads) { + for (int i=0; i putForever(numEntries, entrySize)); + thread.start(); + } + return new OperationResponse(PUT_FOREVER, Status.SUCCESS, 0); + } + + public OperationResponse getForever(final int numEntries, Optional numThreads) { + for (int i=0; i getForever(numEntries)); + thread.start(); + } + return new OperationResponse(GET_FOREVER, Status.SUCCESS, 0); + } + + public OperationResponse destroyForever(final int numEntries, Optional numThreads) { + for (int i=0; i destroyForever(numEntries)); + thread.start(); + } + return new OperationResponse(DESTROY_FOREVER, Status.SUCCESS, 0); + } + + public OperationResponse queryByCusipForever(Optional numThreads) { + for (int i=0; i queryByCusipForever()); + thread.start(); + } + return new OperationResponse(QUERY_BY_CUSIP_FOREVER, Status.SUCCESS, 0); + } + + public OperationResponse functionUpdateForever(final int numEntries, Optional numThreads) { + for (int i=0; i functionUpdateForever(numEntries)); + thread.start(); + } + return new OperationResponse(FUNCTION_UPDATE_FOREVER, Status.SUCCESS, 0); + } + + public OperationResponse[] startTest(int numEntries, int entrySize, Optional numThreads) { + OperationResponse putResponse = putForever(numEntries, entrySize, numThreads); + OperationResponse getResponse = getForever(numEntries, numThreads); + OperationResponse queryResponse = queryByCusipForever(numThreads); + OperationResponse functionResponse = functionUpdateForever(numEntries, numThreads); + return new OperationResponse[] {putResponse, getResponse, queryResponse, functionResponse}; + } + + public OperationResponse stopOperations() { + this.continueOperations = false; + logger.info("Stopping operations"); + return new OperationResponse(STOP_OPERATIONS, Status.SUCCESS, 0); + } + + public Object getMetrics(String type) { + return new Metrics(getClientMetrics(type), getServerMetrics(type)); + } + + private void put(int index, int entrySize, boolean log) { + Trade trade = new Trade(String.valueOf(index), CusipHelper.getCusip(), RANDOM.nextInt(100), new BigDecimal(BigInteger.valueOf(RANDOM.nextInt(100000)), 2), new byte[entrySize]); + trade = this.repository.save(trade); + if (log) { + logger.info("Saved " + trade); + } + } + + private Trade get(int index, boolean log) { + String key = String.valueOf(index); + Optional tradeOptional = this.repository.findById(key); + Trade trade = null; + if (tradeOptional.isPresent()) { + trade = tradeOptional.get(); + } + if (log) { + logger.info(trade == null ? "No trade exists for key=" + key : "Got " + trade); + } + return trade; + } + + private void destroy(int index, boolean log) { + String key = String.valueOf(index); + this.repository.deleteById(key); + if (log) { + logger.info("Destroyed key=" + key); + } + } + + private Collection executeFindByCusipQuery(String cusip) { + return this.repository.findByCusip(cusip); + } + + private Object executUpdateFunction(int index) { + return this.tradeFunctions.updateTrade(Collections.singleton(String.valueOf(index)), RANDOM.nextInt(100), new BigDecimal(BigInteger.valueOf(RANDOM.nextInt(100000)), 2)); + } + + private Map getServerMetrics(String type) { + Map serverMetrics = null; + if (type.equals("all") || type.equals("server")) { + Iterable serverMetricsIter = (Iterable) this.adminFunctions.getMetrics(); + serverMetrics = (Map) serverMetricsIter.iterator().next(); + } + return serverMetrics; + } + + private Map getClientMetrics(String type) { + Map clientMetrics = null; + if (type.equals("all") || type.equals("client")) { + clientMetrics = new TreeMap(); + addOperationMetrics(clientMetrics); + MetricsHelper.addOSMetrics(clientMetrics); + MetricsHelper.addGCMetrics(clientMetrics); + MetricsHelper.addMemoryMetrics(clientMetrics); + } + return clientMetrics; + } + + private void addOperationMetrics(Map clientMetrics) { + Map operationMetrics = new TreeMap(); + clientMetrics.put("operations", operationMetrics); + operationMetrics.put("puts", this.putOperations.get()); + operationMetrics.put("gets", this.getOperations.get()); + operationMetrics.put("destroys", this.destroyOperations.get()); + operationMetrics.put("cusipQueries", this.queryByCusipOperations.get()); + operationMetrics.put("functionUpdates", this.functionUpdateOperations.get()); + } + + private boolean continueOperations() { + return this.continueOperations; + } +} diff --git a/client/src/main/resources/application-local.properties b/client/src/main/resources/application-local.properties new file mode 100644 index 0000000..083d9ff --- /dev/null +++ b/client/src/main/resources/application-local.properties @@ -0,0 +1,10 @@ +# GemFire properties +spring.data.gemfire.name=client +spring.data.gemfire.pool.locators=localhost[10334] +spring.data.gemfire.pool.statistic-interval=1000 +spring.data.gemfire.stats.archive-file=client.gfs +spring.data.gemfire.logging.log-file=client.log + +# Spring Actuator Properties +management.endpoint.health.show-details=always +management.endpoints.web.exposure.include=* diff --git a/client/src/main/resources/application.properties b/client/src/main/resources/application.properties new file mode 100644 index 0000000..adefae8 --- /dev/null +++ b/client/src/main/resources/application.properties @@ -0,0 +1,12 @@ +# GemFire properties +# This property was causing this exception in pcfone: +# org.apache.geode.security.GemFireSecurityException: Instance could not be obtained from org.springframework.data.gemfire.config.annotation.support.AutoConfiguredAuthenticationInitializer.newAuthenticationInitializer +#spring.data.gemfire.pool.statistic-interval=1000 + +# Spring Actuator Properties +management.endpoint.health.show-details=always +management.endpoints.web.exposure.include=* + +# GemFire properties +spring.data.gemfire.stats.archive-file=client.gfs +spring.data.gemfire.logging.log-file=client.log diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..cc4fdc2 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2da813a --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jan 03 13:40:41 PST 2020 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..2fe81a7 --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..24467a1 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..9edda81 --- /dev/null +++ b/server/README.md @@ -0,0 +1,785 @@ +# Spring Boot Data Geode Example + +## Description +This project contains the functions for the Spring Boot Data Geode client. + +It uses: + +- GEODE 1.9.2 + +## Build Application +Build the application jar using **mvn** like: + +``` +mvn clean package +[INFO] Scanning for projects... +[INFO] +[INFO] --------------------------< io.pivotal:test >--------------------------- +[INFO] Building test 0.0.1-SNAPSHOT +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test --- +[INFO] +[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test --- +[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! +[INFO] skip non existing resourceDirectory /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/src/main/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ test --- +[INFO] Changes detected - recompiling the module! +[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! +[INFO] Compiling 2 source files to /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/target/classes +[INFO] /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/src/main/java/io/pivotal/test/server/function/GetMetricsFunction.java: Some input files use unchecked or unsafe operations. +[INFO] /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/src/main/java/io/pivotal/test/server/function/GetMetricsFunction.java: Recompile with -Xlint:unchecked for details. +[INFO] +[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test --- +[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! +[INFO] skip non existing resourceDirectory /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/src/test/resources +[INFO] +[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ test --- +[INFO] No sources to compile +[INFO] +[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test --- +[INFO] No tests to run. +[INFO] +[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ test --- +[INFO] Building jar: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/target/test-0.0.1-SNAPSHOT.jar +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESS +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 1.558 s +[INFO] Finished at: 2019-12-13T09:44:10-08:00 +[INFO] ------------------------------------------------------------------------ +``` + +## Start Locator and Servers +### Local +#### Start Locator and Servers with Configuration +Start and configure the locator and servers using the **startandconfigurelocal.sh** script like: + +``` +startandconfigurelocal.sh +1. Executing - start locator --name=locator + +.... +Locator in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/locator on 192.168.1.4[10334] as locator is currently online. +Process ID: 95653 +Uptime: 5 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/locator/locator.log +JVM Arguments: -Dgemfire.enable-cluster-configuration=true -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +Successfully connected to: JMX Manager [host=192.168.1.4, port=1099] + +Cluster configuration service is up and running. + +2. Executing - set variable --name=APP_RESULT_VIEWER --value=any + +Value for variable APP_RESULT_VIEWER is now: any. + +3. Executing - configure pdx --read-serialized=true + +read-serialized = true +ignore-unread-fields = false +persistent = false +Changes to configuration for group 'cluster' are persisted. + +4. Executing - start server --name=server-1 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +.... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1 on 192.168.1.4[64406] as server-1 is currently online. +Process ID: 95772 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +5. Executing - start server --name=server-2 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2 on 192.168.1.4[64428] as server-2 is currently online. +Process ID: 95791 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +6. Executing - start server --name=server-3 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-3 on 192.168.1.4[64455] as server-3 is currently online. +Process ID: 95799 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-3/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +7. Executing - start server --name=server-4 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +.... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-4 on 192.168.1.4[64486] as server-4 is currently online. +Process ID: 95804 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-4/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +8. Executing - list members + + Name | Id +-------- | -------------------------------------------------------------- +locator | 192.168.1.4(locator:95653:locator):41000 [Coordinator] +server-1 | 192.168.1.4(server-1:95772):41001 +server-2 | 192.168.1.4(server-2:95791):41002 +server-3 | 192.168.1.4(server-3:95799):41003 +server-4 | 192.168.1.4(server-4:95804):41004 + +9. Executing - deploy --jar=target/test-0.0.1-SNAPSHOT.jar + + Member | Deployed JAR | Deployed JAR Location +-------- | ----------------------- | -------------------------------------------------------------------------------------------------- +server-1 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1/test-0.0.1-SNAPSHOT.v1.jar +server-2 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2/test-0.0.1-SNAPSHOT.v1.jar +server-3 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-3/test-0.0.1-SNAPSHOT.v1.jar +server-4 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-4/test-0.0.1-SNAPSHOT.v1.jar + +10. Executing - list functions + + Member | Function +-------- | ------------------- +server-1 | GetMetricsFunction +server-1 | UpdateTradeFunction +server-2 | GetMetricsFunction +server-2 | UpdateTradeFunction +server-3 | GetMetricsFunction +server-3 | UpdateTradeFunction +server-4 | GetMetricsFunction +server-4 | UpdateTradeFunction + +11. Executing - create region --name=Trades --type=PARTITION_REDUNDANT + + Member | Status | Message +-------- | ------ | -------------------------------------- +server-1 | OK | Region "/Trades" created on "server-1" +server-2 | OK | Region "/Trades" created on "server-2" +server-3 | OK | Region "/Trades" created on "server-3" +server-4 | OK | Region "/Trades" created on "server-4" + + + + +Changes to configuration for group 'cluster' are persisted. + +12. Executing - list regions + +List of regions +--------------- +Trades + +13. Executing - create index --name=cusip_index --expression=cusip --region=/Trades + + Member | Status | Message +------------------------------------- | ------ | -------------------------- +192.168.1.4(server-1:95772):41001 | OK | Index successfully created +192.168.1.4(server-2:95791):41002 | OK | Index successfully created +192.168.1.4(server-3:95799):41003 | OK | Index successfully created +192.168.1.4(server-4:95804):41004 | OK | Index successfully created + + + + +Changes to configuration for group 'cluster' are persisted. + +14. Executing - list indexes + +Member Name | Member ID | Region Path | Name | Type | Indexed Expression | From Clause | Valid Index +----------- | ------------------------------------- | ----------- | ----------- | ----- | ------------------ | ----------- | ----------- +server-1 | 192.168.1.4(server-1:95772):41001 | /Trades | cusip_index | RANGE | cusip | /Trades | true +server-2 | 192.168.1.4(server-2:95791):41002 | /Trades | cusip_index | RANGE | cusip | /Trades | true +server-3 | 192.168.1.4(server-3:95799):41003 | /Trades | cusip_index | RANGE | cusip | /Trades | true +server-4 | 192.168.1.4(server-4:95804):41004 | /Trades | cusip_index | RANGE | cusip | /Trades | true + +************************* Execution Summary *********************** +Script file: config/startandconfigurelocal.gfsh + + +Command-1 : start locator --name=locator +Status : PASSED + + + + +Command-2 : set variable --name=APP_RESULT_VIEWER --value=any +Status : PASSED + + + + +Command-3 : configure pdx --read-serialized=true +Status : PASSED + + + + +Command-4 : start server --name=server-1 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-5 : start server --name=server-2 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-6 : start server --name=server-3 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-7 : start server --name=server-4 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-8 : list members +Status : PASSED + + + + +Command-9 : deploy --jar=target/test-0.0.1-SNAPSHOT.jar +Status : PASSED + + + + +Command-10 : list functions +Status : PASSED + + + + +Command-11 : create region --name=Trades --type=PARTITION_REDUNDANT +Status : PASSED + + + + +Command-12 : list regions +Status : PASSED + + + + +Command-13 : create index --name=cusip_index --expression=cusip --region=/Trades +Status : PASSED + + + + +Command-14 : list indexes +Status : PASSED +``` +#### Start Locator and Servers without Configuration +Start the locator and servers without configuration using the **startlocal.sh** script like: + +``` +startlocal.sh +1. Executing - set variable --name=APP_RESULT_VIEWER --value=any + +Value for variable APP_RESULT_VIEWER is now: any. + +2. Executing - start locator --name=locator + +.... +Locator in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/locator on 192.168.1.4[10334] as locator is currently online. +Process ID: 97096 +Uptime: 17 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/locator/locator.log +JVM Arguments: -Dgemfire.enable-cluster-configuration=true -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +Successfully connected to: JMX Manager [host=192.168.1.4, port=1099] + +Cluster configuration service is up and running. + +3. Executing - start server --name=server-1 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1 on 192.168.1.4[64658] as server-1 is currently online. +Process ID: 97126 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +4. Executing - start server --name=server-2 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2 on 192.168.1.4[64682] as server-2 is currently online. +Process ID: 97135 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +5. Executing - start server --name=server-3 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-3 on 192.168.1.4[64711] as server-3 is currently online. +Process ID: 97139 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-3/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +6. Executing - start server --name=server-4 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly + +... +Server in /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-4 on 192.168.1.4[64743] as server-4 is currently online. +Process ID: 97149 +Uptime: 4 seconds +Geode Version: 9.8.3 +Java Version: 1.8.0_121 +Log File: /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-4/cacheserver.log +JVM Arguments: -Dgemfire.default.locators=192.168.1.4[10334] -Dgemfire.start-dev-rest-api=false -Dgemfire.use-cluster-configuration=true -Dgemfire.statistic-archive-file=cacheserver.gfs -Dgemfire.enable-time-statistics=true -Dgemfire.conserve-sockets=false -Dgemfire.log-file=cacheserver.log -XX:NewSize=189m -XX:MaxNewSize=189m -Xms1897m -Xmx1897m -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:OnOutOfMemoryError=kill -KILL %p -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806 +Class-Path: /Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-core-9.8.3.jar:/Users/boglesby/Dev/GemFire/GitBuilds/gemfire983/geode-assembly/build/install/apache-geode/lib/geode-dependencies.jar + +7. Executing - list members + + Name | Id +-------- | -------------------------------------------------------------- +locator | 192.168.1.4(locator:97096:locator):41000 [Coordinator] +server-1 | 192.168.1.4(server-1:97126):41001 +server-2 | 192.168.1.4(server-2:97135):41002 +server-3 | 192.168.1.4(server-3:97139):41003 +server-4 | 192.168.1.4(server-4:97149):41004 + +8. Executing - list functions + + Member | Function +-------- | ------------------- +server-1 | GetMetricsFunction +server-1 | UpdateTradeFunction +server-2 | GetMetricsFunction +server-2 | UpdateTradeFunction +server-3 | GetMetricsFunction +server-3 | UpdateTradeFunction +server-4 | GetMetricsFunction +server-4 | UpdateTradeFunction + +9. Executing - describe region --name=Trades + +Name : Trades +Data Policy : partition +Hosting Members : server-1 + server-4 + server-3 + server-2 + + + + +Non-Default Attributes Shared By Hosting Members + + + Type | Name | Value +--------- | ---------------- | --------- +Region | size | 0 + | data-policy | PARTITION +Partition | redundant-copies | 1 + + + + + +************************* Execution Summary *********************** +Script file: config/startlocal.gfsh + + +Command-1 : set variable --name=APP_RESULT_VIEWER --value=any +Status : PASSED + + + + +Command-2 : start locator --name=locator +Status : PASSED + + + + +Command-3 : start server --name=server-1 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-4 : start server --name=server-2 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-5 : start server --name=server-3 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-6 : start server --name=server-4 --server-port=0 --enable-time-statistics=true --statistic-archive-file=cacheserver.gfs --J=-Dgemfire.conserve-sockets=false --J=-Dgemfire.log-file=cacheserver.log --eviction-heap-percentage=75 --critical-heap-percentage=95 --J=-XX:NewSize=189m --J=-XX:MaxNewSize=189m --J=-Xms1897m --J=-Xmx1897m --J=-XX:CMSInitiatingOccupancyFraction=60 --J=-XX:+UseConcMarkSweepGC --J=-XX:+UseCMSInitiatingOccupancyOnly +Status : PASSED + + + + +Command-7 : list members +Status : PASSED + + + + +Command-8 : list functions +Status : PASSED + + + + +Command-9 : describe region --name=Trades +Status : PASSED +``` +### PCFOne +Configure the servers using the **configurepcc.sh** script like: + +``` +configurepcc.sh +1. Executing - connect --url=https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 --user=cluster_operator_DybzOYuxj2V1QWyfav6hQ --password=******** --skip-ssl-validation + +Successfully connected to: GemFire Manager HTTP service @ https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 + +2. Executing - set variable --name=APP_RESULT_VIEWER --value=any + +Value for variable APP_RESULT_VIEWER is now: any. + +3. Executing - list members + + Name | Id +------------------------------------------------ | -------------------------------------------------------------------------------------- +locator-672f0674-4972-449f-a9b7-fbbaa25a2e18 | 192.168.13.132(locator-672f0674-4972-449f-a9b7-fbbaa25a2e18:6:locator):56152 +locator-6ca5d36b-b0dc-4cd8-887d-ea611f672d70 | 192.168.14.90(locator-6ca5d36b-b0dc-4cd8-887d-ea611f672d70:6:locator):56152 +locator-79d74e75-201a-4479-a351-7795c4962d16 | 192.168.14.91(locator-79d74e75-201a-4479-a351-7795c4962d16:13:locator):56152 +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | 192.168.14.92(cacheserver-db26021f-3861-4017-b838-16d9e62939fe:6):56152 +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | 192.168.14.93(cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140:6):56152 +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | 192.168.14.94(cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5:7):56152 +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | 192.168.14.95(cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92:7):56152 + +4. Executing - deploy --jar=target/test-0.0.1-SNAPSHOT.jar + + Member | Deployed JAR | Deployed JAR Location +------------------------------------------------ | ----------------------- | --------------------------------------------------------- +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar + +5. Executing - list functions + + Member | Function +------------------------------------------------ | ------------------- +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | GetMetricsFunction +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | UpdateTradeFunction +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | GetMetricsFunction +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | UpdateTradeFunction +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | GetMetricsFunction +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | UpdateTradeFunction +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | GetMetricsFunction +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | UpdateTradeFunction + +6. Executing - create region --name=Trades --type=PARTITION_REDUNDANT + + Member | Status | Message +------------------------------------------------ | ------ | ------------------------------------------------------------------------------ +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | OK | Region "/Trades" created on "cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140" +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | OK | Region "/Trades" created on "cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92" +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | OK | Region "/Trades" created on "cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5" +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | OK | Region "/Trades" created on "cacheserver-db26021f-3861-4017-b838-16d9e62939fe" + + + + +Changes to configuration for group 'cluster' are persisted. + +7. Executing - list regions + +List of regions +--------------- +Trades + +8. Executing - create index --name=cusip_index --expression=cusip --region=/Trades + + Member | Status | Message +----------------------------------------------------------------------------- | ------ | -------------------------- +192.168.14.92(cacheserver-db26021f-3861-4017-b838-16d9e62939fe:6):56152 | OK | Index successfully created +192.168.14.93(cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140:6):56152 | OK | Index successfully created +192.168.14.94(cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5:7):56152 | OK | Index successfully created +192.168.14.95(cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92:7):56152 | OK | Index successfully created + + + + +Changes to configuration for group 'cluster' are persisted. + +9. Executing - list indexes + + Member Name | Member ID | Region Path | Name | Type | Indexed Expression | From Clause | Valid Index +------------------------------------------------ | ----------------------------------------------------------------------------- | ----------- | ----------- | ----- | ------------------ | ----------- | ----------- +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | 192.168.14.93(cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140:6):56152 | /Trades | cusip_index | RANGE | cusip | /Trades | true +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | 192.168.14.95(cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92:7):56152 | /Trades | cusip_index | RANGE | cusip | /Trades | true +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | 192.168.14.94(cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5:7):56152 | /Trades | cusip_index | RANGE | cusip | /Trades | true +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | 192.168.14.92(cacheserver-db26021f-3861-4017-b838-16d9e62939fe:6):56152 | /Trades | cusip_index | RANGE | cusip | /Trades | true + +************************* Execution Summary *********************** +Script file: config/configurepcc.gfsh + + +Command-1 : connect --url=https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 --user=cluster_operator_DybzOYuxj2V1QWyfav6hQ --password=tSsw94Rg4IA7vtLyK1Ow --skip-ssl-validation +Status : PASSED + + + + +Command-2 : set variable --name=APP_RESULT_VIEWER --value=any +Status : PASSED + + + + +Command-3 : list members +Status : PASSED + + + + +Command-4 : deploy --jar=target/test-0.0.1-SNAPSHOT.jar +Status : PASSED + + + + +Command-5 : list functions +Status : PASSED + + + + +Command-6 : create region --name=Trades --type=PARTITION_REDUNDANT +Status : PASSED + + + + +Command-7 : list regions +Status : PASSED + + + + +Command-8 : create index --name=cusip_index --expression=cusip --region=/Trades +Status : PASSED + + + + +Command-9 : list indexes +Status : PASSED +``` +## Cleanup +### Local +Cleanup the servers using the **cleanuplocal.sh** script like: + +``` +./cleanuplocal.sh +1. Executing - connect + +Connecting to Locator at [host=localhost, port=10334] .. +Connecting to Manager at [host=192.168.1.4, port=1099] .. +Successfully connected to: [host=192.168.1.4, port=1099] + +2. Executing - set variable --name=APP_RESULT_VIEWER --value=any + +Value for variable APP_RESULT_VIEWER is now: any. + +3. Executing - undeploy + + Member | Un-Deployed JAR | Un-Deployed From JAR Location +-------- | ----------------------- | -------------------------------------------------------------------------------------------------- +server-1 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-1/test-0.0.1-SNAPSHOT.v2.jar +server-2 | test-0.0.1-SNAPSHOT.jar | /Users/boglesby/Dev/Tests/spring-boot/long_running_test/server/server-2/test-0.0.1-SNAPSHOT.v2.jar + +4. Executing - list functions + +No Functions Found + +5. Executing - destroy region --name=Trades + + Member | Status | Message +-------- | ------ | --------------------------------------- +server-1 | OK | Region '/Trades' destroyed successfully +server-2 | OK | Region '/Trades' destroyed successfully + +6. Executing - list regions + +No Regions Found + +************************* Execution Summary *********************** +Script file: cleanuplocal.gfsh + + +Command-1 : connect +Status : PASSED + + + + +Command-2 : set variable --name=APP_RESULT_VIEWER --value=any +Status : PASSED + + + + +Command-3 : undeploy +Status : PASSED + + + + +Command-4 : list functions +Status : PASSED + + + + +Command-5 : destroy region --name=Trades +Status : PASSED + + + + +Command-6 : list regions +Status : PASSED +``` +### PCFOne +Cleanup the servers using the **cleanuppcc.sh** script like: + +``` +./cleanuppcc.sh +1. Executing - connect --url=https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 --user=cluster_operator_DybzOYuxj2V1QWyfav6hQ --password=******** --skip-ssl-validation + +Successfully connected to: GemFire Manager HTTP service @ https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 + +2. Executing - set variable --name=APP_RESULT_VIEWER --value=any + +Value for variable APP_RESULT_VIEWER is now: any. + +3. Executing - undeploy + + Member | Un-Deployed JAR | Un-Deployed From JAR Location +------------------------------------------------ | ----------------------- | --------------------------------------------------------- +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | test-0.0.1-SNAPSHOT.jar | /var/vcap/store/gemfire-server/test-0.0.1-SNAPSHOT.v1.jar + +4. Executing - list functions + +No Functions Found + +5. Executing - destroy region --name=Trades + + Member | Status | Message +------------------------------------------------ | ------ | --------------------------------------- +cacheserver-8317e6d4-3912-4f7c-92ac-f01146875140 | OK | Region '/Trades' destroyed successfully +cacheserver-8693e679-ee85-4ed3-b12c-819e6e81de92 | OK | Region '/Trades' destroyed successfully +cacheserver-c7af346f-d341-48f6-b2c5-021485e29dc5 | OK | Region '/Trades' destroyed successfully +cacheserver-db26021f-3861-4017-b838-16d9e62939fe | OK | Region '/Trades' destroyed successfully + +6. Executing - list regions + +No Regions Found + +************************* Execution Summary *********************** +Script file: cleanuppcc.gfsh + + +Command-1 : connect --url=https://cloudcache-8a2cc6fd-02e0-4a08-ae66-1a3d9566fa89.run.pcfone.io/gemfire/v1 --user=cluster_operator_DybzOYuxj2V1QWyfav6hQ --password=tSsw94Rg4IA7vtLyK1Ow --skip-ssl-validation +Status : PASSED + + + + +Command-2 : set variable --name=APP_RESULT_VIEWER --value=any +Status : PASSED + + + + +Command-3 : undeploy +Status : PASSED + + + + +Command-4 : list functions +Status : PASSED + + + + +Command-5 : destroy region --name=Trades +Status : PASSED + + + + +Command-6 : list regions +Status : PASSED +``` +## Shutdown +### Local +Shutdown the servers and locator using the **shutdownlocal.sh** script like: + +``` +./shutdownlocal.sh + +(1) Executing - connect + +Connecting to Locator at [host=localhost, port=10334] .. +Connecting to Manager at [host=192.168.1.4, port=1099] .. +Successfully connected to: [host=192.168.1.4, port=1099] + + +(2) Executing - shutdown --include-locators=true + +Shutdown is triggered +``` \ No newline at end of file diff --git a/server/bin/cleanup.sh b/server/bin/cleanup.sh new file mode 100755 index 0000000..9971b3a --- /dev/null +++ b/server/bin/cleanup.sh @@ -0,0 +1,8 @@ +gfsh \ +-e "connect --url=$URL --user=$USERNAME --password=$PASSWORD --skip-ssl-validation" \ +-e "set variable --name=APP_RESULT_VIEWER --value=any" \ +-e "undeploy" \ +-e "destroy region --name=Trades" \ +-e "list functions" \ +-e "list regions" \ +-e "list indexes" diff --git a/server/bin/configure.sh b/server/bin/configure.sh new file mode 100755 index 0000000..9a3175d --- /dev/null +++ b/server/bin/configure.sh @@ -0,0 +1,10 @@ +gfsh \ +-e "connect --url=$URL --user=$USERNAME --password=$PASSWORD --skip-ssl-validation" \ +-e "set variable --name=APP_RESULT_VIEWER --value=any" \ +-e "list members" \ +-e "deploy --jar=build/libs/server-0.0.1-SNAPSHOT.jar" \ +-e "list functions" \ +-e "create region --name=Trades --type=PARTITION_REDUNDANT" \ +-e "list regions" \ +-e "create index --name=cusip_index --expression=cusip --region=/Trades" \ +-e "list indexes" diff --git a/server/bin/deployfunctions.sh b/server/bin/deployfunctions.sh new file mode 100755 index 0000000..ec3c1d4 --- /dev/null +++ b/server/bin/deployfunctions.sh @@ -0,0 +1,5 @@ +gfsh \ +-e "connect --url=$URL --user=$USERNAME --password=$PASSWORD --skip-ssl-validation" \ +-e "set variable --name=APP_RESULT_VIEWER --value=any" \ +-e "deploy --jar=build/libs/server-0.0.1-SNAPSHOT.jar" \ +-e "list functions" diff --git a/server/bin/exportlogs.sh b/server/bin/exportlogs.sh new file mode 100755 index 0000000..8fdb7af --- /dev/null +++ b/server/bin/exportlogs.sh @@ -0,0 +1,4 @@ +gfsh \ +-e "connect --url=$URL --user=$USERNAME --password=$PASSWORD --skip-ssl-validation" \ +-e "set variable --name=APP_RESULT_VIEWER --value=any" \ +-e "export logs --file-size-limit=0" \ No newline at end of file diff --git a/server/src/main/java/io/pivotal/test/server/function/GetMetricsFunction.java b/server/src/main/java/io/pivotal/test/server/function/GetMetricsFunction.java new file mode 100644 index 0000000..a603103 --- /dev/null +++ b/server/src/main/java/io/pivotal/test/server/function/GetMetricsFunction.java @@ -0,0 +1,30 @@ +package io.pivotal.test.server.function; + +import io.pivotal.test.server.metrics.MetricsHelper; +import org.apache.geode.cache.execute.Function; +import org.apache.geode.cache.execute.FunctionContext; + +import java.util.Map; +import java.util.TreeMap; + +public class GetMetricsFunction implements Function { + + @Override + public void execute(FunctionContext context) { + Map allMetrics = new TreeMap(); + MetricsHelper.addOSMetrics(allMetrics); + MetricsHelper.addGCMetrics(allMetrics); + MetricsHelper.addMemoryMetrics(allMetrics); + context.getResultSender().lastResult(allMetrics); + } + + @Override + public String getId() { + return getClass().getSimpleName(); + } + + @Override + public boolean optimizeForWrite() { + return true; + } +} diff --git a/server/src/main/java/io/pivotal/test/server/function/UpdateTradeFunction.java b/server/src/main/java/io/pivotal/test/server/function/UpdateTradeFunction.java new file mode 100644 index 0000000..a4413d5 --- /dev/null +++ b/server/src/main/java/io/pivotal/test/server/function/UpdateTradeFunction.java @@ -0,0 +1,39 @@ +package io.pivotal.test.server.function; + +import org.apache.geode.cache.execute.Function; +import org.apache.geode.cache.execute.FunctionContext; +import org.apache.geode.cache.execute.RegionFunctionContext; +import org.apache.geode.pdx.PdxInstance; +import org.apache.geode.pdx.WritablePdxInstance; + +import java.math.BigDecimal; + +public class UpdateTradeFunction implements Function { + + @Override + public void execute(FunctionContext context) { + RegionFunctionContext rfc = (RegionFunctionContext) context; + Object key = rfc.getFilter().iterator().next(); + Object[] arguments = (Object[]) context.getArguments(); + int shares = (Integer) arguments[0]; + BigDecimal price = (BigDecimal) arguments[1]; + PdxInstance tradePdx = (PdxInstance) rfc.getDataSet().get(key); + if (tradePdx != null) { + WritablePdxInstance tradeWritablePdx = tradePdx.createWriter(); + tradeWritablePdx.setField("shares", shares); + tradeWritablePdx.setField("price", price); + rfc.getDataSet().put(key, tradeWritablePdx); + } + context.getResultSender().lastResult(true); + } + + @Override + public String getId() { + return getClass().getSimpleName(); + } + + @Override + public boolean optimizeForWrite() { + return true; + } +} diff --git a/server/src/main/java/io/pivotal/test/server/metrics/MetricsHelper.java b/server/src/main/java/io/pivotal/test/server/metrics/MetricsHelper.java new file mode 100644 index 0000000..47e244d --- /dev/null +++ b/server/src/main/java/io/pivotal/test/server/metrics/MetricsHelper.java @@ -0,0 +1,85 @@ +package io.pivotal.test.server.metrics; + +import org.apache.geode.StatisticDescriptor; +import org.apache.geode.Statistics; +import org.apache.geode.StatisticsType; +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.internal.statistics.platform.LinuxSystemStats; +import org.apache.geode.management.ManagementService; +import org.apache.geode.management.OSMetrics; +import org.apache.geode.management.internal.beans.MemberMBean; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +public class MetricsHelper { + + public static void addOSMetrics(Map allMetrics) { + Cache cache = CacheFactory.getAnyInstance(); + InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem(); + + Map osMetrics = new TreeMap(); + allMetrics.put("os", osMetrics); + ManagementService managementService = ManagementService.getManagementService(cache); + MemberMBean bean = (MemberMBean) managementService.getMemberMXBean(); + OSMetrics osm = bean.showOSMetrics(); + osMetrics.put("fdsOpen", osm.getOpenFileDescriptorCount()); + osMetrics.put("fdLimit", osm.getMaxFileDescriptorCount()); + osMetrics.put("processCpuTime", osm.getProcessCpuTime()); + osMetrics.put("name", osm.getName()); + osMetrics.put("version", osm.getVersion()); + osMetrics.put("architecture", osm.getArch()); + + // If the linux system statistics exist, add them to the os metrics map. + // Otherwise add the available stats from the osmetrics. + Statistics[] systemStatisticsArr = system.findStatisticsByType(LinuxSystemStats.getType()); + if (systemStatisticsArr.length > 0) { + Statistics systemStatistics = systemStatisticsArr[0]; + StatisticsType type = systemStatistics.getType(); + for (StatisticDescriptor descriptor : type.getStatistics()) { + String statName = descriptor.getName(); + Number statValue = systemStatistics.get(statName); + osMetrics.put(statName, statValue); + } + } else { + osMetrics.put("totalMemory", osm.getTotalPhysicalMemorySize()); + osMetrics.put("freeMemory", osm.getFreePhysicalMemorySize()); + osMetrics.put("cpus", osm.getAvailableProcessors()); + osMetrics.put("loadAverage1", osm.getSystemLoadAverage()); + osMetrics.put("allocatedSwap", osm.getTotalSwapSpaceSize()); + osMetrics.put("freeSwap", osm.getFreeSwapSpaceSize()); + } + } + + public static void addGCMetrics(Map allMetrics) { + Map gcMetrics = new TreeMap(); + allMetrics.put("gc", gcMetrics); + List gcBeans = ManagementFactory.getGarbageCollectorMXBeans(); + for (GarbageCollectorMXBean gcBean : gcBeans) { + gcMetrics.put(gcBean.getName() + "_collections", gcBean.getCollectionCount()); + gcMetrics.put(gcBean.getName() + "_collectionTime", gcBean.getCollectionTime()); + } + } + + public static void addMemoryMetrics(Map allMetrics) { + Map memoryMetrics = new TreeMap(); + allMetrics.put("memory", memoryMetrics); + List memoryBeans = ManagementFactory.getMemoryPoolMXBeans(); + for (MemoryPoolMXBean memoryBean : memoryBeans) { + if (memoryBean.getName().contains("Old") || memoryBean.getName().contains("Eden")) { + String memoryBeanName = memoryBean.getName().replaceAll(" ", "_"); + MemoryUsage usage = memoryBean.getUsage(); + memoryMetrics.put(memoryBeanName + "_init", usage.getInit()); + memoryMetrics.put(memoryBeanName + "_used", usage.getUsed()); + memoryMetrics.put(memoryBeanName + "_max", usage.getMax()); + } + } + } +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..efdcae2 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'pcc-long-running-test' +include 'client','client-cq','server' \ No newline at end of file