Skip to content
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

cost insights: make change.ratio optional #5439

Merged
merged 3 commits into from
Apr 29, 2021

Conversation

ryanvazquez
Copy link
Contributor

Hey, I just made a Pull Request!

Makes ChangeStatistic.ratio optional.

Reasoning: Often an entity can incur costs in one period but not in another - such as when a new service is started or decommissioned. This results in either the first or last sum of a change aggregation being zero and growth being technically infinite.

This PR makes ChangeStatistic.ratio optional. Where a ratio is omitted, growth is considered infinite and cost insights will use the ChangeStatistic.amount (which is required) to determine if growth is positive or negative and render the corresponding UI.

Cost Overview Chart

Screen Shot 2021-04-22 at 2 20 28 PM

Screen Shot 2021-04-22 at 2 20 06 PM

Product Insights Card

Cost Growth Indicator omitted

Screen Shot 2021-04-22 at 2 15 22 PM

Product Entity Table

Screen Shot 2021-04-22 at 2 08 02 PM

Screen Shot 2021-04-22 at 2 15 14 PM

Sorts infinite values

infinite-growth-sorting

Zero percent growth means zero percent growth

Screen Shot 2021-04-22 at 2 14 40 PM

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Ryan Vazquez <ryanv@spotify.com>
Signed-off-by: Ryan Vazquez <ryanv@spotify.com>
@ryanvazquez ryanvazquez requested a review from a team as a code owner April 22, 2021 19:36
@changeset-bot
Copy link

changeset-bot bot commented Apr 22, 2021

🦋 Changeset detected

Latest commit: c2abcf9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@backstage/plugin-cost-insights Minor
example-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryanvazquez ryanvazquez added cost-insights plugin A plugin is an extension of Backstage labels Apr 22, 2021
Signed-off-by: Ryan Vazquez <ryanv@spotify.com>
@ryanvazquez ryanvazquez force-pushed the cost-insights-optional-ratio branch from 085183d to c2abcf9 Compare April 22, 2021 19:42
Copy link
Contributor

@bsukh bsukh left a comment

Choose a reason for hiding this comment

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

Nice 🔥🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin A plugin is an extension of Backstage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants