Skip to content

Commit d1c9eba

Browse files
committed
Upgrade to Inverno 1.10.0 + minor changes
1 parent 4d4e53a commit d1c9eba

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

frameworks/Java/inverno/inverno-postgres.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN mvn package -q -Pio.inverno.io_uring
77

88
EXPOSE 8080
99

10-
# CMD [ "target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark" ]
1110
CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \
12-
target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark --com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\"
11+
target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark \
12+
--com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\" \
13+
--com.techempower.inverno.benchmark.appConfiguration.boot.reactor_event_loop_group_size=$((`grep --count ^processor /proc/cpuinfo`))

frameworks/Java/inverno/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.inverno.dist</groupId>
88
<artifactId>inverno-parent</artifactId>
9-
<version>1.9.0</version>
9+
<version>1.10.0</version>
1010
</parent>
1111
<groupId>com.techempower</groupId>
1212
<artifactId>inverno-benchmark</artifactId>
@@ -47,7 +47,7 @@
4747
<groupId>io.inverno.mod</groupId>
4848
<artifactId>inverno-sql-vertx</artifactId>
4949
</dependency>
50-
50+
5151
<dependency>
5252
<groupId>org.unbescape</groupId>
5353
<artifactId>unbescape</artifactId>
@@ -110,7 +110,7 @@
110110
<launchers>
111111
<launcher>
112112
<name>inverno-benchmark</name>
113-
<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64</vmOptions>
113+
<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dlog4j2.level=OFF -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkAccessible=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64</vmOptions>
114114
</launcher>
115115
</launchers>
116116
<archiveFormats>
@@ -157,7 +157,7 @@
157157
<launchers>
158158
<launcher>
159159
<name>inverno-benchmark</name>
160-
<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64</vmOptions>
160+
<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dlog4j2.level=OFF -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkAccessible=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64</vmOptions>
161161
</launcher>
162162
</launchers>
163163
<archiveFormats>

frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
package com.techempower.inverno.benchmark.internal;
22

3-
import java.time.ZonedDateTime;
4-
import java.time.format.DateTimeFormatter;
5-
import java.util.Collections;
6-
import java.util.concurrent.CompletableFuture;
7-
import java.util.concurrent.ThreadLocalRandom;
8-
import java.util.concurrent.TimeUnit;
9-
import java.util.function.Supplier;
10-
113
import com.fasterxml.jackson.core.JsonProcessingException;
124
import com.fasterxml.jackson.databind.ObjectMapper;
135
import com.techempower.inverno.benchmark.model.Fortune;
146
import com.techempower.inverno.benchmark.model.Message;
157
import com.techempower.inverno.benchmark.model.World;
168
import com.techempower.inverno.benchmark.templates.FortunesTemplate;
17-
189
import io.inverno.core.annotation.Bean;
1910
import io.inverno.core.annotation.Bean.Visibility;
2011
import io.inverno.core.annotation.Destroy;
@@ -39,6 +30,13 @@
3930
import io.netty.handler.codec.http.HttpHeaderNames;
4031
import io.netty.handler.codec.http.HttpHeaderValues;
4132
import io.netty.util.AsciiString;
33+
import java.time.ZonedDateTime;
34+
import java.time.format.DateTimeFormatter;
35+
import java.util.Collections;
36+
import java.util.concurrent.CompletableFuture;
37+
import java.util.concurrent.ThreadLocalRandom;
38+
import java.util.concurrent.TimeUnit;
39+
import java.util.function.Supplier;
4240
import reactor.core.publisher.Flux;
4341
import reactor.core.publisher.Mono;
4442

@@ -81,6 +79,8 @@ public void init() {
8179
this.dateEventLoopGroup.scheduleAtFixedRate(() -> {
8280
this.date = new AsciiString(DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now()));
8381
}, 0, 1000, TimeUnit.MILLISECONDS);
82+
83+
8484
}
8585

8686
@Destroy
@@ -133,7 +133,7 @@ public void handle(Exchange<ExchangeContext> exchange) throws HttpException {
133133

134134
private static final ByteBuf STATIC_PLAINTEXT_BYTEBUF;
135135
static {
136-
ByteBuf tmpBuf = Unpooled.directBuffer(STATIC_PLAINTEXT_LEN);
136+
ByteBuf tmpBuf = Unpooled.buffer(STATIC_PLAINTEXT_LEN);
137137
tmpBuf.writeBytes(STATIC_PLAINTEXT);
138138
STATIC_PLAINTEXT_BYTEBUF = Unpooled.unreleasableBuffer(tmpBuf);
139139
}
@@ -172,7 +172,7 @@ public void handle_json(Exchange<ExchangeContext> exchange) throws HttpException
172172
)
173173
.body()
174174
.raw()
175-
.value(Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new Message("Hello, World!")))));
175+
.value(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new Message("Hello, World!"))));
176176
}
177177
catch (JsonProcessingException | IllegalStateException e) {
178178
throw new InternalServerErrorException("Error serializing message as JSON", e);
@@ -196,7 +196,7 @@ public void handle_db(Exchange<ExchangeContext> exchange) throws HttpException {
196196
DB_SELECT_WORLD,
197197
row -> {
198198
try {
199-
return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new World(row.getInteger(0), row.getInteger(1)))));
199+
return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new World(row.getInteger(0), row.getInteger(1))));
200200
}
201201
catch (JsonProcessingException e) {
202202
throw new InternalServerErrorException(e);
@@ -241,7 +241,7 @@ public void handle_queries(Exchange<ExchangeContext> exchange) throws HttpExcept
241241
.collectList()
242242
.map(worlds -> {
243243
try {
244-
return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds)));
244+
return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds));
245245
}
246246
catch (JsonProcessingException e) {
247247
throw new InternalServerErrorException(e);
@@ -278,7 +278,7 @@ public void handle_updates(Exchange<ExchangeContext> exchange) throws HttpExcept
278278
)
279279
.map(worlds -> {
280280
try {
281-
return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds)));
281+
return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds));
282282
}
283283
catch (JsonProcessingException e) {
284284
throw new InternalServerErrorException(e);
@@ -290,7 +290,7 @@ public void handle_updates(Exchange<ExchangeContext> exchange) throws HttpExcept
290290

291291
private static final CharSequence MEDIA_TEXT_HTML_UTF8 = AsciiString.cached("text/html; charset=utf-8");
292292

293-
private static final FortunesTemplate.Renderer<CompletableFuture<ByteBuf>> FORTUNES_RENDERER = FortunesTemplate.bytebuf(() -> Unpooled.unreleasableBuffer(Unpooled.buffer()));
293+
private static final FortunesTemplate.Renderer<CompletableFuture<ByteBuf>> FORTUNES_RENDERER = FortunesTemplate.bytebuf(() -> Unpooled.buffer());
294294

295295
public void handle_fortunes(Exchange<ExchangeContext> exchange) throws HttpException {
296296
exchange.response()

frameworks/Java/inverno/src/main/resources/configuration.cprops

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ com.techempower.inverno.benchmark.appConfiguration {
66
http_server {
77
tls_enabled = false
88
server_port = 8080
9-
h2c_enabled = false
9+
h2_enabled = false
10+
http1x_validate_headers = false
11+
ws_enabled = false
1012
}
1113
db_database = "hello_world"
1214
db_host = "tfb-database"

0 commit comments

Comments
 (0)