chore: update naming

This commit is contained in:
Chirag Aggarwal
2025-02-25 04:43:44 +00:00
parent 0e0bab4c40
commit 7ac4a5bf27
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -1894,7 +1894,7 @@ App::get('/v1/storage/:bucketId/usage')
$metrics = [
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES),
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE),
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_FILES_TRANSFORMATIONS),
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_FILES_IMAGES_TRANSFORMED),
];
@@ -1949,7 +1949,7 @@ App::get('/v1/storage/:bucketId/usage')
'filesStorageTotal' => $usage[$metrics[1]]['total'],
'files' => $usage[$metrics[0]]['data'],
'storage' => $usage[$metrics[1]]['data'],
'fileTransformations' => $usage[$metrics[2]]['data'],
'fileTransformationsTotal' => $usage[$metrics[2]]['total'],
'imageTransformations' => $usage[$metrics[2]]['data'],
'imageTransformationsTotal' => $usage[$metrics[2]]['total'],
]), Response::MODEL_USAGE_BUCKETS);
});
@@ -42,14 +42,14 @@ class UsageBuckets extends Model
'example' => [],
'array' => true
])
->addRule('fileTransformations', [
->addRule('imageTransformations', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated number of files transformations per period.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('fileTransformationsTotal', [
->addRule('imageTransformationsTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated number of files transformations.',
'default' => 0,
@@ -104,7 +104,7 @@ class StorageConsoleClientTest extends Scope
$this->assertIsNumeric($response['body']['filesStorageTotal']);
$this->assertIsArray($response['body']['files']);
$this->assertIsArray($response['body']['storage']);
$this->assertIsArray($response['body']['fileTransformations']);
$this->assertIsNumeric($response['body']['fileTransformationsTotal']);
$this->assertIsArray($response['body']['imageTransformations']);
$this->assertIsNumeric($response['body']['imageTransformationsTotal']);
}
}