fix: backwards compatibility

This commit is contained in:
Torsten Dittmann
2024-09-16 13:49:13 +02:00
parent a5516765b3
commit c5dae9f018
7 changed files with 38 additions and 3 deletions
@@ -37378,6 +37378,12 @@
"x-example": 0,
"format": "int32"
},
"functionsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of functions storage size (in bytes).",
"x-example": 0,
"format": "int32"
},
"buildsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of builds storage size (in bytes).",
@@ -37487,6 +37493,7 @@
"databasesTotal",
"usersTotal",
"filesStorageTotal",
"functionsStorageTotal",
"buildsStorageTotal",
"deploymentsStorageTotal",
"bucketsTotal",
@@ -37378,6 +37378,12 @@
"x-example": 0,
"format": "int32"
},
"functionsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of functions storage size (in bytes).",
"x-example": 0,
"format": "int32"
},
"buildsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of builds storage size (in bytes).",
@@ -37487,6 +37493,7 @@
"databasesTotal",
"usersTotal",
"filesStorageTotal",
"functionsStorageTotal",
"buildsStorageTotal",
"deploymentsStorageTotal",
"bucketsTotal",
@@ -37933,6 +37933,12 @@
"x-example": 0,
"format": "int32"
},
"functionsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of functions storage size (in bytes).",
"x-example": 0,
"format": "int32"
},
"buildsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of builds storage size (in bytes).",
@@ -38051,6 +38057,7 @@
"databasesTotal",
"usersTotal",
"filesStorageTotal",
"functionsStorageTotal",
"buildsStorageTotal",
"deploymentsStorageTotal",
"bucketsTotal",
@@ -37933,6 +37933,12 @@
"x-example": 0,
"format": "int32"
},
"functionsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of functions storage size (in bytes).",
"x-example": 0,
"format": "int32"
},
"buildsStorageTotal": {
"type": "integer",
"description": "Total aggregated sum of builds storage size (in bytes).",
@@ -38051,6 +38057,7 @@
"databasesTotal",
"usersTotal",
"filesStorageTotal",
"functionsStorageTotal",
"buildsStorageTotal",
"deploymentsStorageTotal",
"bucketsTotal",
+1
View File
@@ -272,6 +272,7 @@ App::get('/v1/project/usage')
'usersTotal' => $total[METRIC_USERS],
'bucketsTotal' => $total[METRIC_BUCKETS],
'filesStorageTotal' => $total[METRIC_FILES_STORAGE],
'functionsStorageTotal' => $total[METRIC_DEPLOYMENTS_STORAGE] + $total[METRIC_BUILDS_STORAGE],
'buildsStorageTotal' => $total[METRIC_BUILDS_STORAGE],
'deploymentsStorageTotal' => $total[METRIC_DEPLOYMENTS_STORAGE],
'executionsBreakdown' => $executionsBreakdown,
@@ -40,6 +40,12 @@ class UsageProject extends Model
'default' => 0,
'example' => 0,
])
->addRule('functionsStorageTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated sum of functions storage size (in bytes).',
'default' => 0,
'example' => 0,
])
->addRule('buildsStorageTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated sum of builds storage size (in bytes).',
+3 -3
View File
@@ -143,7 +143,7 @@ class UsageTest extends Scope
);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(19, count($response['body']));
$this->assertEquals(20, count($response['body']));
$this->validateDates($response['body']['network']);
$this->validateDates($response['body']['requests']);
$this->validateDates($response['body']['users']);
@@ -324,7 +324,7 @@ class UsageTest extends Scope
]
);
$this->assertEquals(19, count($response['body']));
$this->assertEquals(20, count($response['body']));
$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']);
@@ -545,7 +545,7 @@ class UsageTest extends Scope
]
);
$this->assertEquals(19, count($response['body']));
$this->assertEquals(20, count($response['body']));
$this->assertEquals(1, count($response['body']['requests']));
$this->assertEquals(1, count($response['body']['network']));
$this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']);