test: Add benchmarks.

The benchmarks can be run using 'mvn verify -Pbenchmark'.

Change-Id: I13058f52bea77aa3cb4f1967126c28e1e98d1838
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
new file mode 100644
index 0000000..1a1c17c
--- /dev/null
+++ b/core/src/test/java/eu/mulk/quarkus/googlecloud/jsonlogging/FormatterBenchmark.java
@@ -0,0 +1,34 @@
+package eu.mulk.quarkus.googlecloud.jsonlogging;
+
+import java.util.List;
+import org.jboss.logmanager.ExtLogRecord;
+import org.openjdk.jmh.annotations.*;
+import org.openjdk.jmh.infra.Blackhole;
+
+@Warmup(iterations = 5, time = 1)
+@Measurement(iterations = 10, time = 1)
+@Fork(value = 1)
+@State(org.openjdk.jmh.annotations.Scope.Benchmark)
+public class FormatterBenchmark {
+
+  private ExtLogRecord simpleLogRecord;
+  private ExtLogRecord structuredLogRecord;
+  private Formatter formatter;
+
+  @Setup
+  public void setup() {
+    simpleLogRecord = FormatterTest.makeSimpleRecord();
+    structuredLogRecord = FormatterTest.makeStructuredRecord();
+    formatter = new Formatter(List.of(), List.of());
+  }
+
+  @Benchmark
+  public void simpleLogRecord(Blackhole blackhole) {
+    blackhole.consume(formatter.format(simpleLogRecord));
+  }
+
+  @Benchmark
+  public void structuredLogRecord(Blackhole blackhole) {
+    blackhole.consume(formatter.format(structuredLogRecord));
+  }
+}