From 1575840c0b4cc035b2ea2a8e2ac0d61ef36dc4bf Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 12 May 2026 15:55:43 +0530 Subject: [PATCH] Move telemetry feature interface --- src/Cache/Adapter/CircuitBreaker.php | 6 +++--- src/Cache/Cache.php | 2 +- src/Cache/Feature/Telemetry.php | 10 ++++++++++ src/Cache/TelemetryAware.php | 10 ---------- tests/Cache/CircuitBreakerTest.php | 4 ++-- tests/Cache/TelemetryTest.php | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 src/Cache/Feature/Telemetry.php delete mode 100644 src/Cache/TelemetryAware.php diff --git a/src/Cache/Adapter/CircuitBreaker.php b/src/Cache/Adapter/CircuitBreaker.php index 2fb9e9eb93..3ef064689d 100644 --- a/src/Cache/Adapter/CircuitBreaker.php +++ b/src/Cache/Adapter/CircuitBreaker.php @@ -3,11 +3,11 @@ namespace Utopia\Cache\Adapter; use Utopia\Cache\Adapter; -use Utopia\Cache\TelemetryAware; +use Utopia\Cache\Feature; use Utopia\CircuitBreaker\CircuitBreaker as UtopiaCircuitBreaker; use Utopia\Telemetry\Adapter as Telemetry; -class CircuitBreaker implements Adapter, TelemetryAware +class CircuitBreaker implements Adapter, Feature\Telemetry { public function __construct( private readonly Adapter $adapter, @@ -106,7 +106,7 @@ class CircuitBreaker implements Adapter, TelemetryAware { $this->breaker->setTelemetry($telemetry); - if ($this->adapter instanceof TelemetryAware) { + if ($this->adapter instanceof Feature\Telemetry) { $this->adapter->setTelemetry($telemetry); } } diff --git a/src/Cache/Cache.php b/src/Cache/Cache.php index 907b8db08d..5a9d4c5695 100644 --- a/src/Cache/Cache.php +++ b/src/Cache/Cache.php @@ -34,7 +34,7 @@ class Cache ['ExplicitBucketBoundaries' => [0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1]] ); - if ($this->adapter instanceof TelemetryAware) { + if ($this->adapter instanceof Feature\Telemetry) { $this->adapter->setTelemetry($telemetry); } } diff --git a/src/Cache/Feature/Telemetry.php b/src/Cache/Feature/Telemetry.php new file mode 100644 index 0000000000..f7026eb262 --- /dev/null +++ b/src/Cache/Feature/Telemetry.php @@ -0,0 +1,10 @@ +