From d36c08c2adf6d9450a947065b27c3204b43bcc81 Mon Sep 17 00:00:00 2001 From: Carl Alexander Date: Thu, 23 Sep 2021 11:34:57 -0400 Subject: [PATCH] feat: add two decimals to object cache request time --- src/ObjectCache/DynamoDbObjectCache.php | 4 ++-- src/ObjectCache/RedisClusterObjectCache.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ObjectCache/DynamoDbObjectCache.php b/src/ObjectCache/DynamoDbObjectCache.php index b1cb1b8..63a08e7 100644 --- a/src/ObjectCache/DynamoDbObjectCache.php +++ b/src/ObjectCache/DynamoDbObjectCache.php @@ -146,7 +146,7 @@ private function getValue(string $key) ]); ++$this->requests; - $this->requestTime += (round(microtime(true) * 1000) - $start); + $this->requestTime += round((microtime(true) * 1000) - $start, 2); if (!isset($response['Item']['value']['S']) || $this->isExpired($response['Item'])) { return false; @@ -175,7 +175,7 @@ private function getValues(array $keys): array ]); ++$this->requests; - $this->requestTime += (round(microtime(true) * 1000) - $start); + $this->requestTime += round((microtime(true) * 1000) - $start, 2); $current = time(); diff --git a/src/ObjectCache/RedisClusterObjectCache.php b/src/ObjectCache/RedisClusterObjectCache.php index 4f9435b..41cf3b9 100644 --- a/src/ObjectCache/RedisClusterObjectCache.php +++ b/src/ObjectCache/RedisClusterObjectCache.php @@ -87,7 +87,7 @@ protected function getValuesFromPersistentCache($keys) $values = is_array($keys) ? $this->getValues($keys) : $this->getValue($keys); ++$this->requests; - $this->requestTime += (round(microtime(true) * 1000) - $start); + $this->requestTime += round((microtime(true) * 1000) - $start, 2); return $values; }