Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement deploymentsStorage metric for projects API #8258

Open
wants to merge 5 commits into
base: 1.5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Small fixes
  • Loading branch information
PineappleIOnic committed Jun 11, 2024
commit d8b893c7c91521cc80a8ad1e4160c81bfdcf0d0c
4 changes: 2 additions & 2 deletions app/controllers/api/project.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
];
}, $dbForProject->find('buckets'));

$deploymentsBreakdown = array_map(function ($function) use ($dbForProject) {
$deploymentsStorageBreakdown = array_map(function ($function) use ($dbForProject) {
$id = $function->getId();
$name = $function->getAttribute('name');
$metric = str_replace(['{resourceType}', '{resourceInternalId}'], ['functions', $function->getInternalId()], METRIC_FUNCTION_ID_DEPLOYMENTS_STORAGE);
Expand Down Expand Up @@ -196,7 +196,7 @@
'deploymentsStorageTotal' => $total[METRIC_DEPLOYMENTS_STORAGE],
'executionsBreakdown' => $executionsBreakdown,
'bucketsBreakdown' => $bucketsBreakdown,
'deploymentsStorageBreakdown' => $deploymentsBreakdown,
'deploymentsStorageBreakdown' => $deploymentsStorageBreakdown,
]), Response::MODEL_USAGE_PROJECT);
});

Expand Down
2 changes: 1 addition & 1 deletion src/Appwrite/Utopia/Response/Model/UsageProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function __construct()
])
->addRule('deploymentsStorageBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of storage used by deployments.',
'description' => 'Aggregated breakdown in totals of deployments storage size (in bytes).',
'default' => [],
'example' => [],
'array' => true
Expand Down