From ccb53ff1d005da45bd1dc9a7f7bf74a1b6831111 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 15 Jun 2022 05:08:23 +0545 Subject: [PATCH] Update src/Appwrite/Stats/Usage.php Co-authored-by: Torsten Dittmann --- src/Appwrite/Stats/Usage.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Stats/Usage.php b/src/Appwrite/Stats/Usage.php index ba1209faf9..c18f852cd6 100644 --- a/src/Appwrite/Stats/Usage.php +++ b/src/Appwrite/Stats/Usage.php @@ -237,7 +237,13 @@ class Usage $filters = ''; } - $query = "SELECT sum(value) AS \"value\" FROM \"{$table}\" WHERE \"time\" > '{$start}' AND \"time\" < '{$end}' AND \"metric_type\"='counter' {$filters} GROUP BY time({$period['key']}), \"projectId\" {$groupBy} FILL(null)"; + $query = "SELECT sum(value) AS \"value\" "; + $query .= "FROM \"{$table}\" "; + $query .= "WHERE \"time\" > '{$start}' "; + $query .= "AND \"time\" < '{$end}' "; + $query .= "AND \"metric_type\"='counter' {$filters} "; + $query .= "GROUP BY time({$period['key']}), \"projectId\" {$groupBy} "; + $query .= "FILL(null)"; $result = $this->influxDB->query($query); $points = $result->getPoints();