-
Notifications
You must be signed in to change notification settings - Fork 210
feat: add screenshots generated metric to billing and usage reports #2798
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -322,6 +322,54 @@ | |
| </svelte:fragment> | ||
| </CardGrid> | ||
|
|
||
| <CardGrid gap="none"> | ||
| <svelte:fragment slot="title">Screenshots generated</svelte:fragment> | ||
| The total number of unique screenshots generated across all projects in your organization. | ||
|
|
||
| <svelte:fragment slot="aside"> | ||
| {#if data.organizationUsage.screenshotsGeneratedTotal} | ||
| {@const current = data.organizationUsage.screenshotsGeneratedTotal} | ||
| <ProgressBarBig | ||
| currentUnit="Screenshots generated" | ||
| currentValue={formatNum(current)} | ||
| progressValue={current} | ||
| showBar={false} /> | ||
| <BarChart | ||
| options={{ | ||
| yAxis: { | ||
| axisLabel: { | ||
| formatter: formatNum | ||
| } | ||
| } | ||
| }} | ||
| series={[ | ||
| { | ||
| name: 'Screenshots generated', | ||
| data: [ | ||
| ...(data.organizationUsage.imageTransformations ?? []).map((e) => [ | ||
| e.date, | ||
| e.value | ||
| ]) | ||
| ] | ||
| } | ||
| ]} /> | ||
|
Comment on lines
+345
to
+355
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Chart uses wrong data source - displays The BarChart is mapping 🐛 Proposed fix series={[
{
name: 'Screenshots generated',
data: [
- ...(data.organizationUsage.imageTransformations ?? []).map((e) => [
+ ...(data.organizationUsage.screenshotsGenerated ?? []).map((e) => [
e.date,
e.value
])
]
}
]} />🤖 Prompt for AI Agents |
||
| {#if projects?.length > 0} | ||
| <ProjectBreakdown {projects} metric="screenshotsGenerated" {usageProjects} /> | ||
| {/if} | ||
| {:else} | ||
| <Card isDashed> | ||
| <div class="u-flex u-cross-center u-flex-vertical u-main-center u-flex"> | ||
| <span | ||
| class="icon-chart-square-bar text-large" | ||
| aria-hidden="true" | ||
| style="font-size: 32px;"></span> | ||
| <p class="u-bold">No data to show</p> | ||
| </div> | ||
| </Card> | ||
| {/if} | ||
| </svelte:fragment> | ||
| </CardGrid> | ||
|
|
||
| <CardGrid gap="none"> | ||
| <svelte:fragment slot="title">Executions</svelte:fragment> | ||
| Calculated for all functions that are executed in all projects in your organization. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,8 @@ | |||||||||||||||||||||||||||||
| data.usage.buildsStorageTotal; | ||||||||||||||||||||||||||||||
| $: imageTransformations = data.usage.imageTransformations; | ||||||||||||||||||||||||||||||
| $: imageTransformationsTotal = data.usage.imageTransformationsTotal; | ||||||||||||||||||||||||||||||
| $: screenshotsGenerated = data.usage.screenshotsGenerated; | ||||||||||||||||||||||||||||||
| $: screenshotsGeneratedTotal = data.usage.screenshotsGeneratedTotal; | ||||||||||||||||||||||||||||||
| $: dbReads = data.usage.databasesReads; | ||||||||||||||||||||||||||||||
| $: dbWrites = data.usage.databasesWrites; | ||||||||||||||||||||||||||||||
|
|
@@ -241,6 +243,44 @@ | |||||||||||||||||||||||||||||
| {/if} | ||||||||||||||||||||||||||||||
| </svelte:fragment> | ||||||||||||||||||||||||||||||
| </CardGrid> | ||||||||||||||||||||||||||||||
| <CardGrid> | ||||||||||||||||||||||||||||||
| <svelte:fragment slot="title">Screenshots generated</svelte:fragment> | ||||||||||||||||||||||||||||||
| Total unique screenshots generated in your project. | ||||||||||||||||||||||||||||||
| <svelte:fragment slot="aside"> | ||||||||||||||||||||||||||||||
| {#if screenshotsGenerated} | ||||||||||||||||||||||||||||||
| {@const current = formatNum(screenshotsGeneratedTotal)} | ||||||||||||||||||||||||||||||
| <div class="u-flex u-flex-vertical"> | ||||||||||||||||||||||||||||||
| <div class="u-flex u-main-space-between"> | ||||||||||||||||||||||||||||||
| <p> | ||||||||||||||||||||||||||||||
| <span class="heading-level-4">{current}</span> | ||||||||||||||||||||||||||||||
| <span class="body-text-1 u-bold">Transformations</span> | ||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
|
Comment on lines
+252
to
+258
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect label: Shows "Transformations" instead of "Screenshots". The label text appears to be a copy/paste artifact from the Image transformations section. It should reflect the "Screenshots generated" metric. ✏️ Proposed fix <div class="u-flex u-flex-vertical">
<div class="u-flex u-main-space-between">
<p>
<span class="heading-level-4">{current}</span>
- <span class="body-text-1 u-bold">Transformations</span>
+ <span class="body-text-1 u-bold">Screenshots</span>
</p>
</div>
</div>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| <BarChart | ||||||||||||||||||||||||||||||
| options={{ | ||||||||||||||||||||||||||||||
| yAxis: { | ||||||||||||||||||||||||||||||
| axisLabel: { | ||||||||||||||||||||||||||||||
| formatter: formatNum | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| series={[ | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| name: 'Screenshots generated', | ||||||||||||||||||||||||||||||
| data: [...screenshotsGenerated.map((e) => [e.date, e.value])] | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ]} /> | ||||||||||||||||||||||||||||||
| {:else} | ||||||||||||||||||||||||||||||
| <Card isDashed> | ||||||||||||||||||||||||||||||
| <Layout.Stack gap="xs" alignItems="center" justifyContent="center"> | ||||||||||||||||||||||||||||||
| <Icon icon={IconChartSquareBar} size="l" /> | ||||||||||||||||||||||||||||||
| <Typography.Text variant="m-600">No data to show</Typography.Text> | ||||||||||||||||||||||||||||||
| </Layout.Stack> | ||||||||||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||||||||||
| {/if} | ||||||||||||||||||||||||||||||
| </svelte:fragment> | ||||||||||||||||||||||||||||||
| </CardGrid> | ||||||||||||||||||||||||||||||
| <CardGrid> | ||||||||||||||||||||||||||||||
| <svelte:fragment slot="title">Executions</svelte:fragment> | ||||||||||||||||||||||||||||||
| Calculated for all functions that are executed in this project. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.