From fb7b3d0f13bac6c37184a124bd55641e48f66866 Mon Sep 17 00:00:00 2001 From: Alexandre Choura Date: Wed, 27 Dec 2023 10:54:00 +0100 Subject: [PATCH] Modify MessagePackSerializationBench.php & TraceAnnotationsBench.php to be coherent --- tests/Benchmarks/API/MessagePackSerializationBench.php | 5 ++++- tests/Benchmarks/API/TraceAnnotationsBench.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Benchmarks/API/MessagePackSerializationBench.php b/tests/Benchmarks/API/MessagePackSerializationBench.php index d2431d6af94..93b2241a729 100644 --- a/tests/Benchmarks/API/MessagePackSerializationBench.php +++ b/tests/Benchmarks/API/MessagePackSerializationBench.php @@ -21,7 +21,10 @@ public function benchMessagePackSerialization($traceArray) public function provideTraceArrays() { for ($i = 0; $i < 100; $i++) { - \DDTrace\start_span(); + $span = \DDTrace\start_span(); + $span->name = 'bench.trace_serialization'; + $span->meta['foo'] = 'bar'; + $span->metrics['bar'] = 1; } for ($i = 0; $i < 100; $i++) { diff --git a/tests/Benchmarks/API/TraceAnnotationsBench.php b/tests/Benchmarks/API/TraceAnnotationsBench.php index c79275882f7..68f57de965c 100644 --- a/tests/Benchmarks/API/TraceAnnotationsBench.php +++ b/tests/Benchmarks/API/TraceAnnotationsBench.php @@ -14,7 +14,9 @@ class TraceAnnotationsBench */ public function benchTraceAnnotationOverhead() { - $this->dummyFunction(); + for ($i = 0; $i < 1000; $i++) { + $this->dummyFunction(); + } } #[\DDTrace\Trace]