diff --git a/src/Appwrite/Event/Usage.php b/src/Appwrite/Event/Usage.php index 89e900d2ab..761c9400c8 100644 --- a/src/Appwrite/Event/Usage.php +++ b/src/Appwrite/Event/Usage.php @@ -51,6 +51,22 @@ class Usage extends Event return $this; } + /** + * Add group. + * + * @param string $key + * @return self + */ + public function addGroup(string $key): self + { + + $this->metrics[] = [ + 'group' => $key, + ]; + + return $this; + } + /** * Sends metrics to the usage worker. * diff --git a/src/Appwrite/Platform/Workers/UsageDump.php b/src/Appwrite/Platform/Workers/UsageDump.php index 3e50ba0363..b9d81f6c13 100644 --- a/src/Appwrite/Platform/Workers/UsageDump.php +++ b/src/Appwrite/Platform/Workers/UsageDump.php @@ -78,7 +78,6 @@ class UsageDump extends Action /** * End temp bug fallback */ - $numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0; $receivedAt = $stats['receivedAt'] ?? 'NONE'; if ($numberOfKeys === 0) {