Skip to content

fix: remove all-time usage stats from functions, sites, and storage#3013

Merged
HarshMN2345 merged 5 commits intomainfrom
fix-remove-misleading-usage-stats
May 4, 2026
Merged

fix: remove all-time usage stats from functions, sites, and storage#3013
HarshMN2345 merged 5 commits intomainfrom
fix-remove-misleading-usage-stats

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

The *Total fields returned by the API represent all-time entity counts (databases, buckets, files, deployments) that do not change with the selected date range. Showing these alongside period selectors caused customer confusion when comparing against billing stats.

  • Remove Usage tab and page content for functions, sites, and storage sections where only all-time counts were displayed
  • Keep databases usage page with reads/writes (period-specific)
  • Keep individual function usage page with executions and GB hours (period-specific)
  • Fix typo in function header tab event name (sage -> usage)

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

…d storage

The *Total fields returned by the API represent all-time entity counts
(databases, buckets, files, deployments) that do not change with the
selected date range. Showing these alongside period selectors caused
customer confusion when comparing against billing stats.

- Remove Usage tab and page content for functions, sites, and storage
  sections where only all-time counts were displayed
- Keep databases usage page with reads/writes (period-specific)
- Keep individual function usage page with executions and GB hours (period-specific)
- Fix typo in function header tab event name (sage -> usage)
@HarshMN2345 HarshMN2345 changed the title fix: remove misleading all-time usage stats from functions, sites, and storage fix: remove all-time usage stats from functions, sites, and storage Apr 30, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR removes all-time (non-period-specific) usage stat pages from functions, sites, and storage to avoid confusion when customers compare against billing stats. Nav tabs are removed from all relevant headers, page content is cleared, and data loaders are stripped down to return empty objects — correctly eliminating the previously wasteful API calls. The databases usage page is correctly preserved with its period-specific reads/writes charts, and the sage typo in the function header tab event name is fixed to usage.

The one remaining nit is that sites/site-[site]/usage/+page.svelte still declares export let data; even though all template bindings were removed — it's the only emptied page where the prop wasn't cleaned up alongside the reactive statements.

Confidence Score: 5/5

Safe to merge; all changes are removals of all-time stat UI with no functional regressions.

All P1+ issues from prior review rounds have been addressed (loaders return {}, unused imports cleaned up). The only remaining item is a P2 dead export let data declaration in the site-specific usage page, which has no runtime impact.

src/routes/(console)/project-[region]-[project]/sites/site-[site]/usage/[[period]]/+page.svelte — dangling export let data prop.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/usage/[[period]]/+page.svelte Correctly removes all-time total databases count while preserving period-specific reads/writes charts.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/header.svelte Fixes typo in tab event name: 'sage' → 'usage'. Clean, correct fix.
src/routes/(console)/project-[region]-[project]/functions/usage/[[period]]/+page.ts Loader correctly stripped down to return empty object, eliminating the unnecessary listUsage API call.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/usage/[[period]]/+page.svelte Empties page content but leaves a dangling export let data; that is no longer consumed by the template.
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/usage/[[period]]/+page.ts Loader stripped to return empty object, eliminating the unnecessary getBucketUsage API call.

Reviews (3): Last reviewed commit: "Revert "fix: remove databases reads/writ..." | Re-trigger Greptile

Stop unnecessary API calls on usage routes that no longer render
anything. Replace each loader with an empty return and remove
leftover export let data bindings from the page components.
Comment on lines +1 to +5
<script lang="ts">
import { Container, UsageMultiple } from '$lib/layout';

export let data;

$: reads = data.databaseReads;
$: readsTotal = data.databaseReadsTotal;

$: writes = data.databaseWrites;
$: writesTotal = data.databaseWritesTotal;
import { Container } from '$lib/layout';
</script>

<Container databasesMainScreen>
<UsageMultiple
title="Reads and writes"
showHeader={false}
total={[readsTotal, writesTotal]}
count={[reads, writes]}
legendNumberFormat="abbreviate"
legendData={[
{ name: 'Reads', value: readsTotal },
{ name: 'Writes', value: writesTotal }
]} />
</Container>
<Container></Container>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Databases reads/writes removed despite PR description

The PR description explicitly states "Keep databases usage page with reads/writes (period-specific)", but both the individual database usage page (this file) and the top-level databases/usage/+page.svelte have been emptied, and their nav tabs removed from both databases/database-[database]/header.svelte and databases/header.svelte. Unlike the all-time entity counts removed from functions/sites/storage, database reads and writes are period-specific and directly meaningful for billing comparison — exactly the data the PR says should be preserved.

Copy link
Copy Markdown
Member Author

@HarshMN2345 HarshMN2345 Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldadfux should I remove them?
They are correct and are from time period 1st-30th of each month

@HarshMN2345 HarshMN2345 merged commit 58c51fe into main May 4, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-remove-misleading-usage-stats branch May 4, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants