Add gbHours metrics to functions

This commit is contained in:
Bradley Schofield
2024-07-05 13:27:58 +09:00
parent ca2d111815
commit 1bb3e52df5
@@ -9,6 +9,8 @@
export let data: PageData;
$: total = data.executionsTotal;
$: count = data.executions;
$: gbHoursTotal = data.executionsMbSecondsTotal / 1000 / 3600;
$: mbSecondsCount = data.executionsMbSeconds;
</script>
<Container>
@@ -46,4 +48,24 @@
]} />
</Card>
{/if}
<div class="u-flex u-main-space-between common-section">
<Heading tag="h2" size="5">GB Hours</Heading>
</div>
{#if count}
<Card>
<Heading tag="h6" size="6">{formatNumberWithCommas(gbHoursTotal)}</Heading>
<p>GB Hours</p>
<div class="u-margin-block-start-16" />
<BarChart
series={[
{
name: 'Count of gbHours over time',
data: [...mbSecondsCount.map((e) => [e.date,
Math.ceil((e.value / 1000 / 3600) * 1000) / 1000
])]
}
]} />
</Card>
{/if}
</Container>