Merge pull request #4765 from appwrite/lohanidamodar-patch-2
fix hourly stats
This commit is contained in:
commit
948b14d139
1 changed files with 3 additions and 3 deletions
|
@ -27,8 +27,8 @@ App::get('/v1/project/usage')
|
|||
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
|
||||
$periods = [
|
||||
'24h' => [
|
||||
'period' => '30m',
|
||||
'limit' => 48,
|
||||
'period' => '1h',
|
||||
'limit' => 24,
|
||||
],
|
||||
'7d' => [
|
||||
'period' => '1d',
|
||||
|
@ -82,7 +82,7 @@ App::get('/v1/project/usage')
|
|||
while ($backfill > 0) {
|
||||
$last = $limit - $backfill - 1; // array index of last added metric
|
||||
$diff = match ($period) { // convert period to seconds for unix timestamp math
|
||||
'30m' => 1800,
|
||||
'1h' => 3600,
|
||||
'1d' => 86400,
|
||||
};
|
||||
$stats[$metric][] = [
|
||||
|
|
Loading…
Reference in a new issue