Merge pull request #2051 from appwrite/fix-calc-usage

Fix: usage calc on function.
This commit is contained in:
Darshan
2025-06-26 20:16:16 +05:30
committed by GitHub
2 changed files with 8 additions and 1 deletions
@@ -9,6 +9,12 @@
$: count = data.executions;
$: gbHoursTotal = data.executionsMbSecondsTotal / 1000 / 3600;
$: mbSecondsCount = data.executionsMbSeconds;
$: gbHoursCount = data.executionsMbSeconds
?.map((metric) => ({
...metric,
value: metric.value / 1000 / 3600
}))
.filter(({ value }) => value);
</script>
<Container>
@@ -33,7 +39,7 @@
title: 'Total GB hours'
}}
total={gbHoursTotal}
count={mbSecondsCount} />
count={gbHoursCount} />
{/if}
</Layout.Stack>
</Container>
@@ -7,6 +7,7 @@ export const load: PageLoad = async ({ params }) => {
const period = isValueOfStringEnum(FunctionUsageRange, params.period)
? params.period
: FunctionUsageRange.ThirtyDays;
return sdk
.forProject(params.region, params.project)
.functions.getUsage(params.function, period);