[COST-4913] Add ability to distribute unattributed storage cost. #5102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira Ticket
COST-4913
Description
This change will add the ability to distribute cost associated with the
Unattributed storage
project. The work for calculating the unattributed storage is still ongoing; however, we can test that distribution works by changing a namespace to the value of the project that would be distributed in the future.Testing
Unattributed Storage
projectThe distribution for storage unattributed is based off of the name of the namespace. We can convert an existing namespace over to this project for the purposes of testing if the distribution algorithm is working correctly.
PGPASSWORD=postgres psql postgres -U postgres -h localhost -p 15432
set search_path=org1234567;
Pick out a namespace:
Switch all of the infrastructure raw cost related to one of these namespaces to the
Storage unattributed
project:Storage unattributed
project.The cost model will be applied to the current data in the daily summary table.
http://localhost:8000/api/cost-management/v1/sources/?type=OCP
Find the uuid for the
Test OCP on Azure
source.Send a post to:
Body:
Check the total sum:
This should be very close to 0, we negate the cost we distribute as we go. So the combined cost should be zero.
Check the negated cost:
This will match the cost
Check the distributed cost:
Release Notes