Browse Source

Update 2.3.0 (#6396)

* Update 2.3.0

* Update CachedWorld.java

* Update Service.java

* Update benchmark_config.json

* Update redkale-postgres.dockerfile

* Update redkale.dockerfile

* Update config.toml

* Update README.md
Redkale 4 years ago
parent
commit
b00db41dbf

+ 3 - 3
frameworks/Java/redkale/README.md

@@ -51,15 +51,15 @@ This is the Redkale portion of a [benchmarking test suite](../) comparing a vari
 
 
 ### Database Queries Test
 ### Database Queries Test
 
 
-    http://localhost:8080/queries?queries=5
+    http://localhost:8080/queries?q=5
 
 
 ### Database Caching Test
 ### Database Caching Test
 
 
-    http://localhost:8080/cached-worlds?count=5
+    http://localhost:8080/cached-worlds?q=5
 
 
 ### Database Update Test
 ### Database Update Test
 
 
-    http://localhost:8080/updates?queries=5
+    http://localhost:8080/updates?q=5
 
 
 ### Template rendering Test
 ### Template rendering Test
 
 

+ 5 - 5
frameworks/Java/redkale/benchmark_config.json

@@ -2,8 +2,8 @@
   "framework": "redkale",
   "framework": "redkale",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",      
+      "plaintext_url": "/plaintext",   
+      "json_url": "/json",   
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
       "classification": "Fullstack",
       "classification": "Fullstack",
@@ -21,11 +21,11 @@
       "versus": ""
       "versus": ""
     },
     },
 	"postgres": {
 	"postgres": {
+      "cached_query_url": "/cached-worlds?q=",
       "db_url": "/db",
       "db_url": "/db",
-      "query_url": "/queries?queries=",
       "fortune_url": "/fortunes",
       "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=",
-      "cached_query_url": "/cached-worlds?count=",
+      "query_url": "/queries?q=",
+      "update_url": "/updates?q=",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
       "classification": "Fullstack",
       "classification": "Fullstack",

+ 1 - 4
frameworks/Java/redkale/conf/application.xml

@@ -2,17 +2,14 @@
 
 
 <application port="8585">     
 <application port="8585">     
     
     
-    <!--  see: http://redkale.org/redkale.html#redkale_confxml  -->
-    
     <resources>
     <resources>
 		<executor threads="0"/>
 		<executor threads="0"/>
 		<properties>		
 		<properties>		
-            <property name="system.property.http.response.header.server" value="redkale"/>
             <property name="system.property.http.response.header.connection" value="none"/>
             <property name="system.property.http.response.header.connection" value="none"/>
         </properties>
         </properties>
     </resources> 
     </resources> 
         
         
-    <server protocol="HTTP" host="0.0.0.0" port="8080">      
+    <server protocol="HTTP" lazy="true" port="8080">      
                 
                 
         <response>
         <response>
 			<contenttype plain="text/plain" json="application/json"/>  
 			<contenttype plain="text/plain" json="application/json"/>  

+ 5 - 4
frameworks/Java/redkale/config.toml

@@ -11,13 +11,14 @@ database_os = "Linux"
 os = "Linux"
 os = "Linux"
 orm = "Raw"
 orm = "Raw"
 platform = "Redkale"
 platform = "Redkale"
-webserver = "None"
+webserver = "Redkale"
 versus = ""
 versus = ""
 
 
 [postgres]
 [postgres]
 urls.db = "/db"
 urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
+urls.query = "/queries?q="
+urls.update = "/updates?q="
+urls.cached_query = "/cached-worlds?q="
 urls.fortune = "/fortunes"
 urls.fortune = "/fortunes"
 approach = "Realistic"
 approach = "Realistic"
 classification = "Fullstack"
 classification = "Fullstack"
@@ -26,5 +27,5 @@ database_os = "Linux"
 os = "Linux"
 os = "Linux"
 orm = "Raw"
 orm = "Raw"
 platform = "Redkale"
 platform = "Redkale"
-webserver = "None"
+webserver = "Redkale"
 versus = ""
 versus = ""

+ 1 - 1
frameworks/Java/redkale/redkale-postgres.dockerfile

@@ -9,4 +9,4 @@ FROM openjdk:11.0.3-jdk-slim
 WORKDIR /redkale
 WORKDIR /redkale
 COPY conf conf
 COPY conf conf
 COPY --from=maven /redkale/target/redkale-benchmark-1.0.0.jar redkale-benchmark.jar
 COPY --from=maven /redkale/target/redkale-benchmark-1.0.0.jar redkale-benchmark.jar
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-DAPP_HOME=./", "-jar", "redkale-benchmark.jar"]
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-DAPP_HOME=./", "-jar", "redkale-benchmark.jar"]

+ 1 - 1
frameworks/Java/redkale/redkale.dockerfile

@@ -9,4 +9,4 @@ FROM openjdk:11.0.3-jdk-slim
 WORKDIR /redkale
 WORKDIR /redkale
 COPY conf conf
 COPY conf conf
 COPY --from=maven /redkale/target/redkale-benchmark-1.0.0.jar redkale-benchmark.jar
 COPY --from=maven /redkale/target/redkale-benchmark-1.0.0.jar redkale-benchmark.jar
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-DAPP_HOME=./", "-jar", "redkale-benchmark.jar"]
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-DAPP_HOME=./", "-jar", "redkale-benchmark.jar"]

+ 1 - 1
frameworks/Java/redkale/src/main/java/org/redkalex/benchmark/CachedWorld.java

@@ -11,7 +11,7 @@ import javax.persistence.*;
  *
  *
  * @author zhangjx
  * @author zhangjx
  */
  */
-@Cacheable
+@Cacheable(direct=true)
 @Table(name = "World")
 @Table(name = "World")
 public class CachedWorld extends World {
 public class CachedWorld extends World {
 
 

+ 16 - 16
frameworks/Java/redkale/src/main/java/org/redkalex/benchmark/Service.java

@@ -41,8 +41,8 @@ public class Service extends AbstractService {
     }
     }
 
 
     @RestMapping(name = "cached-worlds")
     @RestMapping(name = "cached-worlds")
-    public CachedWorld[] cachedWorlds(int count) {
-        final int size = Math.min(500, Math.max(1, count));
+    public CachedWorld[] cachedWorlds(int q) {
+        final int size = Math.min(500, Math.max(1, q));
         final CachedWorld[] worlds = new CachedWorld[size];
         final CachedWorld[] worlds = new CachedWorld[size];
         for (int i = 0; i < size; i++) {
         for (int i = 0; i < size; i++) {
             worlds[i] = source.find(CachedWorld.class, randomId());
             worlds[i] = source.find(CachedWorld.class, randomId());
@@ -55,9 +55,19 @@ public class Service extends AbstractService {
         return source.findAsync(World.class, randomId());
         return source.findAsync(World.class, randomId());
     }
     }
 
 
+    @RestMapping(name = "fortunes")
+    public CompletableFuture<HttpResult<String>> queryFortunes() {
+        return source.queryListAsync(Fortune.class).thenApply((fortunes) -> {
+            fortunes.add(new Fortune(0, "Additional fortune added at request time."));
+            Collections.sort(fortunes);
+            String html = FortunesTemplate.template(fortunes).render().toString();
+            return new HttpResult("text/html; charset=UTF-8", html);
+        });
+    }
+
     @RestMapping(name = "queries")
     @RestMapping(name = "queries")
-    public CompletableFuture<World[]> queryWorldAsync(int queries) {
-        final int size = Math.min(500, Math.max(1, queries));
+    public CompletableFuture<World[]> queryWorldAsync(int q) {
+        final int size = Math.min(500, Math.max(1, q));
         final World[] worlds = new World[size];
         final World[] worlds = new World[size];
         final AtomicInteger index = new AtomicInteger();
         final AtomicInteger index = new AtomicInteger();
         final Function<?, CompletableFuture> func = f -> source.findAsync(World.class, randomId())
         final Function<?, CompletableFuture> func = f -> source.findAsync(World.class, randomId())
@@ -70,8 +80,8 @@ public class Service extends AbstractService {
     }
     }
 
 
     @RestMapping(name = "updates")
     @RestMapping(name = "updates")
-    public CompletableFuture<World[]> updateWorldAsync(int queries) {
-        final int size = Math.min(500, Math.max(1, queries));
+    public CompletableFuture<World[]> updateWorldAsync(int q) {
+        final int size = Math.min(500, Math.max(1, q));
         final World[] worlds = new World[size];
         final World[] worlds = new World[size];
         final AtomicInteger index = new AtomicInteger();
         final AtomicInteger index = new AtomicInteger();
         final Function<?, CompletableFuture> func = f -> source.findAsync(World.class, randomId())
         final Function<?, CompletableFuture> func = f -> source.findAsync(World.class, randomId())
@@ -90,16 +100,6 @@ public class Service extends AbstractService {
         }).thenApply(v -> worlds);
         }).thenApply(v -> worlds);
     }
     }
 
 
-    @RestMapping(name = "fortunes")
-    public CompletableFuture<HttpResult<String>> queryFortunes() {
-        return source.queryListAsync(Fortune.class).thenApply((fortunes) -> {
-            fortunes.add(new Fortune(0, "Additional fortune added at request time."));
-            Collections.sort(fortunes);
-            String html = FortunesTemplate.template(fortunes).render().toString();
-            return new HttpResult("text/html; charset=UTF-8", html);
-        });
-    }
-
     private int randomId() {
     private int randomId() {
         return 1 + random.nextInt(10000);
         return 1 + random.nextInt(10000);
     }
     }