| 1 |
<?php |
| 2 |
namespace Wikimedia\Telemetry; |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class NoopTracer implements TracerInterface { |
| 12 |
|
| 13 |
private SpanContext $noopSpanContext; |
| 14 |
|
| 15 |
public function __construct() { |
| 16 |
$this->noopSpanContext = new SpanContext( '', '', null, '', false ); |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
public function createSpan( string $spanName, $parentSpan = null ): SpanInterface { |
| 21 |
return new NoopSpan( $this->noopSpanContext ); |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
public function createRootSpan( string $spanName ): SpanInterface { |
| 26 |
return new NoopSpan( $this->noopSpanContext ); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
public function createSpanWithParent( string $spanName, SpanContext $parentSpanContext ): SpanInterface { |
| 31 |
return new NoopSpan( $this->noopSpanContext ); |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
public function shutdown(): void { |
| 36 |
|
| 37 |
} |
| 38 |
} |