Skip to content

Commit

Permalink
Adjust savings plan rate to match cost and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
esebesto committed Aug 19, 2024
1 parent 02b12f0 commit d85d0ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.6.9"
__version__ = "4.6.10"


VERSION = __version__.split(".")
2 changes: 1 addition & 1 deletion nise/generators/aws/data_transfer_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _update_data(self, row, start, end, **kwargs):
row["pricing/term"] = "OnDemand"
row["pricing/unit"] = "GB"
row["savingsPlan/SavingsPlanEffectiveCost"] = str(saving)
row["savingsPlan/SavingsPlanRate"] = str(saving)
row["savingsPlan/SavingsPlanRate"] = str(round(float(saving) / amount, 4)) if saving else str(saving)

# Overwrite lineItem/LineItemType for items with applied Savings plan
if saving is not None:
Expand Down
2 changes: 1 addition & 1 deletion nise/generators/aws/ec2_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def _update_data(self, row, start, end, **kwargs):
row["pricing/term"] = "OnDemand"
row["pricing/unit"] = "Hrs"
row["savingsPlan/SavingsPlanEffectiveCost"] = saving
row["savingsPlan/SavingsPlanRate"] = saving
row["savingsPlan/SavingsPlanRate"] = round(float(saving) / float(amount), 5) if saving and amount else saving

# Overwrite lineItem/LineItemType for items with applied Savings plan
if saving is not None:
Expand Down

0 comments on commit d85d0ce

Please sign in to comment.