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

[FEAT-778] Calculate cost for GCP Redis instances #1227

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

titanventura
Copy link
Contributor

Fixes #778

Problem

Currently the cost for GCP redis instances are not calculated.

Changes Made

  • Added cost calculation logic for GCP redis instances.

Notes

Need to test with actual GCP account

Checklist

Reviewers

@jakepage91 @mlabouardy

Signed-off-by: titanventura <aswath7862001@gmail.com>
Copy link
Collaborator

@Azanul Azanul left a comment

Choose a reason for hiding this comment

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

  • Encapsulate the price list fetching logic in a function
  • fix the magic numbers, declare them glabally

}

func getStartTime(createTime, now time.Time) time.Time {
firstOfCurrentMonth := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you check with other places in the code and see if this is the same? I think we use UTC time.
Also, it'd be great if we had a util function for doing this repetitive task, since we do it across all the providers.

Copy link
Collaborator

@Azanul Azanul left a comment

Choose a reason for hiding this comment

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

Keeping a note that we need to make a few utils for GCP as well when we extend GCP support

@jakepage91 jakepage91 self-requested a review December 15, 2023 15:01
Copy link
Contributor

@jakepage91 jakepage91 left a comment

Choose a reason for hiding this comment

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

LGTM

@jakepage91 jakepage91 merged commit c2abda5 into tailwarden:develop Dec 15, 2023
3 checks passed
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.

Calculate cost for GCP Redis instances
3 participants