1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

organize metrics

This commit is contained in:
Damodar Lohani 2022-08-13 05:02:18 +00:00
parent c1c325505b
commit 560bd97fcd

View file

@ -2475,12 +2475,12 @@ App::get('/v1/databases/:databaseId/usage')
]; ];
$metrics = [ $metrics = [
'documents.' . $databaseId . '.count.total',
'collections.' . $databaseId . '.count.total', 'collections.' . $databaseId . '.count.total',
'collections.' . $databaseId . '.requests.create', 'collections.' . $databaseId . '.requests.create',
'collections.' . $databaseId . '.requests.read', 'collections.' . $databaseId . '.requests.read',
'collections.' . $databaseId . '.requests.update', 'collections.' . $databaseId . '.requests.update',
'collections.' . $databaseId . '.requests.delete', 'collections.' . $databaseId . '.requests.delete',
'documents.' . $databaseId . '.count.total',
'documents.' . $databaseId . '.requests.create', 'documents.' . $databaseId . '.requests.create',
'documents.' . $databaseId . '.requests.read', 'documents.' . $databaseId . '.requests.read',
'documents.' . $databaseId . '.requests.update', 'documents.' . $databaseId . '.requests.update',
@ -2528,16 +2528,16 @@ App::get('/v1/databases/:databaseId/usage')
$usage = new Document([ $usage = new Document([
'range' => $range, 'range' => $range,
'documentsCount' => $stats["documents.{$databaseId}.count.total"],
'collectionsCount' => $stats["collections.{$databaseId}.count.total"], 'collectionsCount' => $stats["collections.{$databaseId}.count.total"],
'documentsCreate' => $stats["documents.{$databaseId}.requests.create"],
'documentsRead' => $stats["documents.{$databaseId}.requests.read"],
'documentsUpdate' => $stats["documents.{$databaseId}.requests.update"],
'documentsDelete' => $stats["documents.{$databaseId}.requests.delete"],
'collectionsCreate' => $stats["collections.{$databaseId}.requests.create"], 'collectionsCreate' => $stats["collections.{$databaseId}.requests.create"],
'collectionsRead' => $stats["collections.{$databaseId}.requests.read"], 'collectionsRead' => $stats["collections.{$databaseId}.requests.read"],
'collectionsUpdate' => $stats["collections.{$databaseId}.requests.update"], 'collectionsUpdate' => $stats["collections.{$databaseId}.requests.update"],
'collectionsDelete' => $stats["collections.{$databaseId}.requests.delete"], 'collectionsDelete' => $stats["collections.{$databaseId}.requests.delete"],
'documentsCount' => $stats["documents.{$databaseId}.count.total"],
'documentsCreate' => $stats["documents.{$databaseId}.requests.create"],
'documentsRead' => $stats["documents.{$databaseId}.requests.read"],
'documentsUpdate' => $stats["documents.{$databaseId}.requests.update"],
'documentsDelete' => $stats["documents.{$databaseId}.requests.delete"],
]); ]);
} }