diff --git a/src/Appwrite/Usage/Calculators/Database.php b/src/Appwrite/Usage/Calculators/Database.php index 66ad5a50ed..8b55e45ecf 100644 --- a/src/Appwrite/Usage/Calculators/Database.php +++ b/src/Appwrite/Usage/Calculators/Database.php @@ -216,10 +216,8 @@ class Database extends Calculator */ private function count(UtopiaDatabase $database, string $projectId, string $collection, ?string $metric = null): int { - $this->database->setNamespace('_' . $projectId); - try { - $count = $this->database->count($collection); + $count = $database->count($collection); if (!is_null($metric)) { $this->createPerPeriodMetric($database, $projectId, (string) $metric, $count); } diff --git a/src/Appwrite/Usage/Calculators/TimeSeries.php b/src/Appwrite/Usage/Calculators/TimeSeries.php index 392984c161..af2da31c6a 100644 --- a/src/Appwrite/Usage/Calculators/TimeSeries.php +++ b/src/Appwrite/Usage/Calculators/TimeSeries.php @@ -303,7 +303,6 @@ class TimeSeries extends Calculator private function createOrUpdateMetric(string $projectId, string $time, string $period, string $metric, int $value, int $type): void { $id = \md5("{$time}_{$period}_{$metric}"); - $this->database->setNamespace('console'); $project = $this->database->getDocument('projects', $projectId); $database = call_user_func($this->getProjectDB, $project);