Skip to content

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

Open
HarshMN2345 wants to merge 4 commits intomainfrom
fix-remove-misleading-usage-stats
Open

fix: remove all-time usage stats from functions, sites, and storage#3013
HarshMN2345 wants to merge 4 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 entity-count usage stats (deployments, buckets, files) from functions, sites, and storage — fixing customer confusion when these non-time-ranged totals appeared alongside period selectors. It also fixes a typo (sageusage) in the individual function tab event name.

  • Databases reads/writes unintentionally removed: The PR description says "Keep databases usage page with reads/writes (period-specific)", but all four databases usage files are emptied and both nav tabs are removed — both at the top-level (databases/header.svelte, databases/usage/+page.svelte) and per-database (database-[database]/header.svelte, database-[database]/usage/+page.svelte). Reads and writes are period-specific metrics, not all-time counts, and appear to have been removed by mistake.

Confidence Score: 4/5

Safe to merge for functions/sites/storage changes, but the databases reads/writes removal contradicts the stated intent and should be confirmed before merging.

One P1 finding: databases reads/writes (period-specific) are removed despite the PR description explicitly saying to preserve them. All other changes (functions, sites, storage) are clean and well-scoped.

databases/database-[database]/usage/[[period]]/+page.svelte, databases/usage/[[period]]/+page.svelte, databases/database-[database]/header.svelte, databases/header.svelte

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/header.svelte Removes Usage nav tab from individual database header — contradicts PR description which says to keep databases reads/writes (period-specific)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.svelte Clears reads/writes charts and data bindings, leaving an empty Container — contradicts stated intent to preserve period-specific database usage
src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.ts Replaces the reads/writes SDK call with a no-op loader — correct if the page is truly being removed, but misaligns with PR description
src/routes/(console)/project-[region]-[project]/databases/header.svelte Removes Usage tab from top-level databases header — also contradicts PR description
src/routes/(console)/project-[region]-[project]/databases/usage/[[period]]/+page.svelte Clears total-databases count AND reads/writes charts from top-level databases usage page
src/routes/(console)/project-[region]-[project]/functions/function-[function]/header.svelte Fixes typo in event name: 'sage' → 'usage' for the individual function Usage tab
src/routes/(console)/project-[region]-[project]/functions/header.svelte Removes Usage nav tab from top-level functions header as intended
src/routes/(console)/project-[region]-[project]/functions/usage/[[period]]/+page.svelte Empties functions usage page (all-time deployment count removed) and cleans up unused imports
src/routes/(console)/project-[region]-[project]/sites/site-[site]/usage/[[period]]/+page.svelte Empties site-specific usage page; retains export let data (stale prop, covered in prior review thread)
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/usage/[[period]]/+page.svelte Empties bucket usage page (all-time file/transformation counts removed) and cleans up unused imports correctly
src/routes/(console)/project-[region]-[project]/sites/header.svelte Removes Usage nav tab from top-level sites header as intended
src/routes/(console)/project-[region]-[project]/sites/site-[site]/header.svelte Removes Usage nav tab from individual site header as intended
src/routes/(console)/project-[region]-[project]/storage/header.svelte Removes Usage nav tab from top-level storage header as intended
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/header.svelte Removes Usage nav tab from individual bucket header as intended

Reviews (2): Last reviewed commit: "fix: remove databases reads/writes usage..." | 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

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.

1 participant