test: Add benchmark with many log entry fields.
Change-Id: I9ef4ff2bc0ccd8c0b674b9e8cd0c1e93fbe445ff
diff --git a/core/src/test/java/eu/mulk/quarkus/googlecloud/jsonlogging/FormatterBenchmark.java b/core/src/test/java/eu/mulk/quarkus/googlecloud/jsonlogging/FormatterBenchmark.java
index 1a1c17c..4900a01 100644
--- a/core/src/test/java/eu/mulk/quarkus/googlecloud/jsonlogging/FormatterBenchmark.java
+++ b/core/src/test/java/eu/mulk/quarkus/googlecloud/jsonlogging/FormatterBenchmark.java
@@ -13,12 +13,14 @@
private ExtLogRecord simpleLogRecord;
private ExtLogRecord structuredLogRecord;
+ private ExtLogRecord massivelyStructuredLogRecord;
private Formatter formatter;
@Setup
public void setup() {
simpleLogRecord = FormatterTest.makeSimpleRecord();
structuredLogRecord = FormatterTest.makeStructuredRecord();
+ massivelyStructuredLogRecord = FormatterTest.makeMassivelyStructuredRecord();
formatter = new Formatter(List.of(), List.of());
}
@@ -31,4 +33,10 @@
public void structuredLogRecord(Blackhole blackhole) {
blackhole.consume(formatter.format(structuredLogRecord));
}
+
+ @Benchmark
+ public void massivelyStructuredLogRecord(Blackhole blackhole) {
+ var f = formatter.format(massivelyStructuredLogRecord);
+ blackhole.consume(f);
+ }
}