mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix: use size actual instead
This commit is contained in:
@@ -125,9 +125,9 @@ $databaseListener = function (string $event, Document $document, Document $proje
|
||||
$bucketInternalId = $parts[1];
|
||||
$queueForUsage
|
||||
->addMetric(METRIC_FILES, $value) // per project
|
||||
->addMetric(METRIC_FILES_STORAGE, $document->getAttribute('sizeOriginal') * $value) // per project
|
||||
->addMetric(METRIC_FILES_STORAGE, $document->getAttribute('sizeActual') * $value) // per project
|
||||
->addMetric(str_replace('{bucketInternalId}', $bucketInternalId, METRIC_BUCKET_ID_FILES), $value) // per bucket
|
||||
->addMetric(str_replace('{bucketInternalId}', $bucketInternalId, METRIC_BUCKET_ID_FILES_STORAGE), $document->getAttribute('sizeOriginal') * $value); // per bucket
|
||||
->addMetric(str_replace('{bucketInternalId}', $bucketInternalId, METRIC_BUCKET_ID_FILES_STORAGE), $document->getAttribute('sizeActual') * $value); // per bucket
|
||||
break;
|
||||
case $document->getCollection() === 'functions':
|
||||
$queueForUsage
|
||||
|
||||
@@ -328,7 +328,7 @@ class UsageTest extends Scope
|
||||
$this->assertEquals(1, count($response['body']['requests']));
|
||||
$this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']);
|
||||
$this->validateDates($response['body']['requests']);
|
||||
$this->assertEquals($storageTotal, $response['body']['filesStorageTotal']);
|
||||
$this->assertGreaterThan($storageTotal, $response['body']['filesStorageTotal']);
|
||||
|
||||
$response = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
@@ -336,7 +336,7 @@ class UsageTest extends Scope
|
||||
$this->getConsoleHeaders()
|
||||
);
|
||||
|
||||
$this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']);
|
||||
$this->assertGreaterThan($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']);
|
||||
$this->validateDates($response['body']['storage']);
|
||||
$this->assertEquals($bucketsTotal, $response['body']['buckets'][array_key_last($response['body']['buckets'])]['value']);
|
||||
$this->validateDates($response['body']['buckets']);
|
||||
@@ -349,7 +349,7 @@ class UsageTest extends Scope
|
||||
$this->getConsoleHeaders()
|
||||
);
|
||||
|
||||
$this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']);
|
||||
$this->assertGreaterThan($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']);
|
||||
$this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']);
|
||||
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user