woocommerce
/
vendor
/
wordpress
/
mcp-adapter
/
includes
/
Infrastructure
/
Observability
/
NullMcpObservabilityHandler.php
woocommerce
/
vendor
/
wordpress
/
mcp-adapter
/
includes
/
Infrastructure
/
Observability
Last commit date
Contracts
7 months ago
ConsoleObservabilityHandler.php
7 months ago
ErrorLogMcpObservabilityHandler.php
7 months ago
McpObservabilityHelperTrait.php
7 months ago
NullMcpObservabilityHandler.php
7 months ago
NullMcpObservabilityHandler.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * NullMcpObservabilityHandler class for handling MCP observability without tracking. |
| 4 | * |
| 5 | * @package McpAdapter |
| 6 | */ |
| 7 | |
| 8 | declare( strict_types=1 ); |
| 9 | |
| 10 | namespace WP\MCP\Infrastructure\Observability; |
| 11 | |
| 12 | /** |
| 13 | * Class NullMcpObservabilityHandler |
| 14 | * |
| 15 | * This class handles MCP observability by doing nothing. It is used when no |
| 16 | * observability tracking is desired, providing zero overhead. |
| 17 | * |
| 18 | * @package WP\MCP\ObservabilityHandlers |
| 19 | */ |
| 20 | class NullMcpObservabilityHandler implements Contracts\McpObservabilityHandlerInterface { |
| 21 | |
| 22 | /** |
| 23 | * Emit a countable event for tracking with optional timing data. |
| 24 | * |
| 25 | * This method does nothing and is used when no observability tracking is desired. |
| 26 | * |
| 27 | * @param string $event The event name to record. |
| 28 | * @param array $tags Optional tags to attach to the event. |
| 29 | * @param float|null $duration_ms Optional duration in milliseconds for timing measurements. |
| 30 | * |
| 31 | * @return void |
| 32 | */ |
| 33 | public function record_event( string $event, array $tags = array(), ?float $duration_ms = null ): void { |
| 34 | // Do nothing. |
| 35 | } |
| 36 | } |
| 37 |