Skip to content

Commit 47e2988

Browse files
committed
add bench
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent c9cfa60 commit 47e2988

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,25 @@
1212
import io.prometheus.metrics.model.snapshots.SummarySnapshot;
1313
import io.prometheus.metrics.model.snapshots.SummarySnapshot.SummaryDataPointSnapshot;
1414
import io.prometheus.metrics.model.snapshots.Unit;
15-
import java.io.ByteArrayOutputStream;
16-
import java.io.IOException;
17-
import java.io.OutputStream;
1815
import org.openjdk.jmh.annotations.Benchmark;
1916
import org.openjdk.jmh.annotations.Scope;
2017
import org.openjdk.jmh.annotations.State;
2118

19+
import java.io.ByteArrayOutputStream;
20+
import java.io.IOException;
21+
import java.io.OutputStream;
22+
23+
/**
24+
* Results on a machine with dedicated Ubuntu 24.04 LTS, AMD Ryzen™ 9 7900 × 24, 96.0 GiB RAM:
25+
*
26+
* <pre>
27+
* Benchmark Mode Cnt Score Error Units
28+
* TextFormatUtilBenchmark.openMetricsWriteToByteArray thrpt 25 846397.071 ± 8835.379 ops/s
29+
* TextFormatUtilBenchmark.openMetricsWriteToNull thrpt 25 862205.960 ± 14185.181 ops/s
30+
* TextFormatUtilBenchmark.prometheusWriteToByteArray thrpt 25 916443.104 ± 7359.549 ops/s
31+
* TextFormatUtilBenchmark.prometheusWriteToNull thrpt 25 907473.591 ± 12615.214 ops/s
32+
* </pre>
33+
*/
2234
public class TextFormatUtilBenchmark {
2335

2436
private static final MetricSnapshots SNAPSHOTS;

0 commit comments

Comments
 (0)