Skip to content

Savings History KPI units wrong ($/hr vs $/mo) + add Hourly/Monthly/Yearly dropdown #750

Description

@cristim

Symptom

On the Purchases page "Savings History" widget, the three KPIs display with inconsistent and seemingly-wrong units:

  • Period Savings: $1.15 (no unit suffix)
  • Avg Hourly Savings: $1.15/hr
  • Peak Savings: $1.15/hr

Two issues:

  1. Peak Savings is labeled /hr but the underlying value is monthly. With the single committed purchase being a t4g.nano AWS ec2 reservation, the monthly saving is ~$1.15/month. $1.15/hr would be ~$840/month -- not what's actually happening. So the unit label is wrong.
  2. Avg Hourly Savings is also labeled /hr but is likely the same monthly number. Same coincidence of value as Peak.

Feature ask

Add a dropdown on the Savings History widget to switch the view between Hourly / Monthly / Yearly, and have all three KPIs (Period / Avg / Peak) re-render in the selected unit.

Acceptance criteria

  • Peak Savings shows the correct unit suffix matching the underlying value (likely /mo for the current data).
  • Avg savings shows the correct unit suffix matching the underlying value.
  • A dropdown lets the user switch all three KPIs to Hourly / Monthly / Yearly consistently.
  • The chart period selector (currently 7d / 30d / 90d / All) is independent of this unit selector.

Files likely involved

  • frontend/src/modules/savings-history.ts (KPI rendering + period selector)
  • internal/api/analytics_postgres.go or wherever the Period / Avg / Peak values are computed -- confirm whether the API already returns multiple unit variants or only one.

Source

QA exploratory testing, 2026-05-27.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions